Created
September 5, 2017 14:22
Star
You must be signed in to star a gist
Delphi Function FileSize
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// returns file size in bytes or -1 if not found. | |
function FileSize(fileName : wideString) : Int64; | |
var | |
sr : TSearchRec; | |
begin | |
if FindFirst(fileName, faAnyFile, sr ) = 0 then | |
result := Int64(sr.FindData.nFileSizeHigh) shl Int64(32) + Int64(sr.FindData.nFileSizeLow) | |
else | |
result := -1; | |
FindClose(sr); | |
end; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment