Calculate the file length in bytes.
long _filelength (int handle);
long filelength (int handle);
Required Header |
<io.h> |
Return Value
Each of these functions returns the length in bytes of a file. -1 indicates an error.
Parameters
handle
An open low level file handle
Remarks
The _filelength function records the current position of the file handle and reads until the End Of File to determine its length in bytes before returning to the original file position. If the file is in write mode, then the current file position is returned without any further calculation performed.
The file read operation in this instance uses a special read mode which bypasses the buffer calculations which normally occur when reading a file in the JCC library.