summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2009-10-01 16:42:26 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2009-10-01 16:42:26 +0200
commit1580df25724ca9e27f9a58675d305c5cad697831 (patch)
tree0e7eaf71e05a4252a359b5b32e0b3f312f14e2d1
parent2758e8e23d8f8b45ac2a81ffd0792e4dd5ba40db (diff)
downloadfpGUI-1580df25724ca9e27f9a58675d305c5cad697831.tar.xz
New utility method GetFileSize() that takes a full filename as parameter.
Signed-off-by: Graeme Geldenhuys <graeme@mastermaths.co.za>
-rw-r--r--src/nvUtilities.pas15
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.