diff options
author | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-01 16:42:26 +0200 |
---|---|---|
committer | Graeme Geldenhuys <graeme@mastermaths.co.za> | 2009-10-01 16:42:26 +0200 |
commit | 1580df25724ca9e27f9a58675d305c5cad697831 (patch) | |
tree | 0e7eaf71e05a4252a359b5b32e0b3f312f14e2d1 /src | |
parent | 2758e8e23d8f8b45ac2a81ffd0792e4dd5ba40db (diff) | |
download | fpGUI-1580df25724ca9e27f9a58675d305c5cad697831.tar.xz |
New utility method GetFileSize() that takes a full filename as parameter.
Signed-off-by: Graeme Geldenhuys <graeme@mastermaths.co.za>
Diffstat (limited to 'src')
-rw-r--r-- | src/nvUtilities.pas | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/nvUtilities.pas b/src/nvUtilities.pas index 212ac8e8..1af9b6cf 100644 --- a/src/nvUtilities.pas +++ b/src/nvUtilities.pas @@ -32,6 +32,8 @@ Function ExtractNextValueNoTrim( procedure MemCopy(const src; var dest; size: SizeInt); // Allows for debug output and quite disable of output procedure ProfileEvent(const AString: string); +// Return AFilename's size in bytes +function GetFileSize(const AFilename: string): integer; implementation @@ -83,5 +85,18 @@ begin {$ENDIF} end; +function GetFileSize(const AFilename: string): integer; +var + f: File; +begin + Result := 0; + Assign(f, AFileName); + {$i-} + Reset(f); + {$i+} + Result := FileSize(f); + CloseFile(f); +end; + end. |