[fpc-devel] Determin file size - how?

Michael Van Canneyt michael at freepascal.org
Wed Dec 14 23:42:09 CET 2011



On Wed, 14 Dec 2011, Hans-Peter Diettrich wrote:

> I wonder how to obtain the size of an file on disk. The only function I could 
> find so far is FileSize, which requires an open File, but nothing for an file 
> name :-(
>
> ATM FileSize(TEXT) would help, too, but FileSize only accepts an FILE, not 
> TEXT :-(
>
> FpFStat() seems unavailable on Windows :-(
>
> FindFirst may be usable, but is very clumsy for this simple request.

Nevertheless, it is the only option.

For example FileAge also calls FindFirst.

Michael.



More information about the fpc-devel mailing list