Changes the size of a file opened with a low-level file function.
- Specifies the file handle of the file whose size you wish to change. The file handle is returned by FOPEN(В ) when you open the file or by FCREATE(В ) when you create the file. If a file is opened with FOPEN(В ), it must be opened with write or read/write privileges to be able to change its size.
- Specifies the new file size in bytes. If nNewFileSize is less than the original file size, the file is truncated. If nNewFileSize is greater than the original file size, the file size is increased.
Use FCHSIZE(В ) to increase the file's size or truncate the file after a specified byte.
When a file's size is increased, Microsoft Visual FoxPro allocates sectors for the file on the drive where the file is opened. Since FCHSIZE(В ) does not initialize the new file space, the space can contain previous data. Be sure to manage the new file space.
The final size of the file in bytes is returned. Visual FoxPro returns вЂ“1 if FCHSIZE(В ) is unable to change the file size if, for example, an invalid file handle is specified because of insufficient disk space, or if the file is read-only.
|This function can be used to truncate a file to length 0.|