You can retrieve the current status of an open file by using the low-level, C run-time function fstat. This function fills a structure with information about a file, such as its length in bytes (specified in the size field) and the date and time it was created. The following example fills the FileStatus structure with information about the FILE.TXT file:
stat FileStatus;
.
.
.
fstat(hFile, FileStatus);