Version 5 of file size

Updated 2003-10-02 21:29:14

file size name

Returns a decimal string giving the size of file name in bytes. If the file doesn't exist or its size cannot be queried then an error is generated.


Before Tcl 8.4a4, file size would actually throw an error on a file larger than 2gb. Now it works, and returns the correct value for such 'large files'.

file size must return the complete size of a file including any data which the OS might not yet have written to disk. On Unix this is easy, but on Windows, Tcl actually has to force the OS to flush all buffers before returning the information. (Of course all of this happens behind the scenes).


See also:


Tcl syntax help - Category Command - Category Introspection