나는 파일 크기 알이 rutine 있습니다델파이 XE2에서 크로스 플랫폼 방식으로 파일 크기를 얻을 방법
[DCC Warning] Funciones.pas(61): W1002 Symbol 'FindData' is specific to a platform
이이 경고를주고, 그러나
(http://delphi.about.com/od/delphitips2008/qt/filesize.htm 기준)
function FileSize(fileName : String) : Int64;
var
sr : TSearchRec;
begin
if FindFirst(fileName, faAnyFile, sr) = 0 then
{$IFDEF MSWINDOWS}
result := Int64(sr.FindData.nFileSizeHigh) shl Int64(32) + Int64(sr.FindData.nFileSizeLow)
{$ELSE}
result := sr.Size
{$ENDIF}
else
result := -1;
FindClose(sr) ;
end;
을
이 작업을 수행하기위한 명확한 교차 플랫폼 방식이 존재하는지 궁금합니다. 내가 TFile 클래스를 확인하고 그것을 찾지 못했습니다 ...
FindFirst가 파일 크기 정보를 얻는 방법 인 것처럼 보입니다. 직관적이고 항상 정확한 것은 아닙니다. –