标签:
function GetFileSize(const FileName: String): LongInt;
var SearchRec: TSearchRec;
begin
if FindFirst(ExpandFileName(FileName), faAnyFile, SearchRec) = 0 then
Result := SearchRec.Size
else
Result := -1;
end;
//按书上所说,函数都是具有返回值的,它这else返回的是-1,超出2GB?
//那么这样对不对呢?
function GetFileSize(const FileName: String): Int64;
var SearchRec: TSearchRec;
begin
if FindFirst(ExpandFileName(FileName), faAnyFile, SearchRec) = 0 then
Result := SearchRec.Size
else
Result := -1;
end;
标签:
原文地址:http://www.cnblogs.com/FanYs/p/4337736.html