Author Topic: file pointers in WIN32  (Read 1471 times)

0 Members and 1 Guest are viewing this topic.

Offline NOVARSEG

  • Forum Resident
  • Posts: 509
    • View Profile
file pointers in WIN32
« on: October 27, 2020, 01:55:45 am »
Ok was reading WIN32 on file pointers and max file size for file pointer operations is approx 2GB 2^31 -2
from : https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfilepointer
"
Although the parameter lpDistanceToMoveHigh is used to manipulate huge files, the value of the parameter should be set when moving files of any size. If it is set to NULL, then lDistanceToMove has a maximum value of 2^31–2, or 2 gigabytes less 2, because all file pointer values are signed values. Therefore, if there is even a small chance for the file to increase to that size, it is best to treat the file as a huge file and work with 64-bit file pointers. With file compression on the NTFS file system, and sparse files, it is possible to have files that are large even if the underlying volume is not very large.
"

Don't use signed variables as file pointers!!!..         With QB 4.5 and a86 assembler I can do file pointer operations with 4GB files

To do that use:  interrupt in DOS 4.0+ - EXTENDED OPEN/CREATE
http://www.ctyme.com/intr/rb-3179.htm

Here is the DOS INTERUPT for file pointer operations:
http://www.ctyme.com/intr/rb-2799.htm

This has been possible since 1986 with 16 bit programs but now WIN32 wants us to use 64 bit code to do the same thing HUH.

Ok maybe 1996 when fat32 came out
« Last Edit: October 27, 2020, 10:47:03 pm by NOVARSEG »