#DiskReads & Size?
03-Feb-94 17:37:56
Sb: #39264-#DiskReads & Size?
Fm: Jim Butterfield 73624,14
To: New member 73016,27
There are quite a few ways of finding the size of a file. Traditional method:
get a lock on the file, set aside an InfoData area, and then call
Info(lock,info_Data). You can read file size in bytes OR in blocks from the
FileInfoBlock. Don't forget to release the lock when you're done. Anothe way,
when the file has been opened, is to use the Seek(handle, position, mode) call.
Since mode permits OFFSET_BEGINNING, OFFSET_CURRENT, and OFFSET_END, and the
Seek function returns "oldPosition", it's not hard to work out the sequence to
get a file length.
–Jim