PDA

View Full Version : Checking file size



walfridson
05-26-2009, 08:46 AM
Any one knows how to check a open files size?
Opening in binary and checking linecount isn't really that precise.

LightFreeze
05-28-2009, 05:36 PM
A filestat() function has been added to return various system-related values associated
with the file on disc. When passed a valid filename, filestat() returns (in order)
the file's last access time, creation time, and last modification time, the file size,
the number of links to the file (useful only under UNIX or NTFS file systems), the
file owner's user id (useful only under UNIX), and the file's group id (also useful
only under UNIX).
...
(a,c,m,s,l,u,g) = filestat("/etc/profile");
...
All values are integer, and the access, creation, and modification times are suitable
for use as arguments to the time() and date() functions.

might do the trick

walfridson
05-29-2009, 05:54 AM
Ah thanks, will report if it's better