FileByteSize function

This commit is contained in:
mysticbbs 2012-08-17 14:37:57 -04:00
parent faeea67a7a
commit dc488533f9
1 changed files with 15 additions and 1 deletions

View File

@ -39,6 +39,7 @@ Procedure DirClean (Path: String; Exempt: String);
Function FileRename (OldFN, NewFN: String) : Boolean; Function FileRename (OldFN, NewFN: String) : Boolean;
Function FileCopy (Source, Target: String) : Boolean; Function FileCopy (Source, Target: String) : Boolean;
Function FileFind (FN: String) : String; Function FileFind (FN: String) : String;
Function FileByteSize (FN: String) : Int64;
{ GLOBAL FILEIO VARIABLES AND CONSTANTS } { GLOBAL FILEIO VARIABLES AND CONSTANTS }
@ -746,4 +747,17 @@ Begin
FindClose(Dir); FindClose(Dir);
End; End;
Function FileByteSize (FN: String) : Int64;
Var
Dir : SearchRec;
Begin
Result := -1;
FindFirst (FN, AnyFile, Dir);
If DosError = 0 Then Result := Dir.Size;
FindClose(Dir);
End;
End. End.