@@ -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.