mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-16 10:19:30 +02:00
* make statx based Sysutils.FileAge working with relative pathes
+ test
git-svn-id: trunk@48519 -
(cherry picked from commit b08717fef6
)
This commit is contained in:
parent
a67b55f7fe
commit
43f3819feb
@ -574,7 +574,7 @@ begin
|
||||
|
||||
{$ifdef USE_STATX}
|
||||
{ first try statx }
|
||||
if (statx(0,pchar(SystemFileName),0,STATX_MTIME or STATX_MODE,Infox)>=0) and not(fpS_ISDIR(Infox.stx_mode)) then
|
||||
if (statx(AT_FDCWD,pchar(SystemFileName),0,STATX_MTIME or STATX_MODE,Infox)>=0) and not(fpS_ISDIR(Infox.stx_mode)) then
|
||||
begin
|
||||
Result:=Infox.stx_mtime.tv_sec;
|
||||
exit;
|
||||
|
@ -7,4 +7,12 @@ begin
|
||||
writeln('Compilation time and run time differ too much, SysUtils.FileAge buggy?');
|
||||
halt(1);
|
||||
end;
|
||||
|
||||
{ test with relative path }
|
||||
if 3600*24*(now()-FileDateToDateTime(FileAge(ExtractRelativePath(GetCurrentDir+DirectorySeparator,paramstr(0)))))>7200 then
|
||||
begin
|
||||
writeln('FileAge returns: ',FileDateToDateTime(FileAge(paramstr(0))));
|
||||
writeln('Compilation time and run time differ too much, SysUtils.FileAge buggy?');
|
||||
halt(1);
|
||||
end;
|
||||
end.
|
||||
|
Loading…
Reference in New Issue
Block a user