mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 13:49:29 +02:00
- Removed UnixToWinAge, since revision 444 it does not change its argument, but wastes a lot of CPU cycles converting it from local time and back.
git-svn-id: trunk@23145 -
This commit is contained in:
parent
cecea651b2
commit
1415569ecb
@ -525,17 +525,6 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
{$ifndef FPUNONE}
|
||||
Function UnixToWinAge(UnixAge : time_t): Longint;
|
||||
|
||||
Var
|
||||
Y,M,D,hh,mm,ss : word;
|
||||
|
||||
begin
|
||||
EpochToLocal(UnixAge,y,m,d,hh,mm,ss);
|
||||
Result:=DateTimeToFileDate(EncodeDate(y,m,d)+EncodeTime(hh,mm,ss,0));
|
||||
end;
|
||||
|
||||
|
||||
Function FileAge (Const FileName : String): Longint;
|
||||
|
||||
@ -545,9 +534,8 @@ begin
|
||||
If (fpstat (pointer(FileName),Info)<0) or fpS_ISDIR(info.st_mode) then
|
||||
exit(-1)
|
||||
else
|
||||
Result:=UnixToWinAge(info.st_mtime);
|
||||
Result:=info.st_mtime;
|
||||
end;
|
||||
{$endif}
|
||||
|
||||
|
||||
Function FileExists (Const FileName : String) : Boolean;
|
||||
@ -725,9 +713,7 @@ begin
|
||||
f.Attr:=WinAttr;
|
||||
f.Size:=st.st_Size;
|
||||
f.Mode:=st.st_mode;
|
||||
{$ifndef FPUNONE}
|
||||
f.Time:=UnixToWinAge(st.st_mtime);
|
||||
{$endif}
|
||||
f.Time:=st.st_mtime;
|
||||
FindGetFileInfo:=true;
|
||||
End
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user