mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 17:19:33 +02:00
* statx based Sysutils.FileGetDate with handle fixed
+ test
git-svn-id: trunk@48520 -
(cherry picked from commit 3e453f92fc
)
This commit is contained in:
parent
dcde27b8c6
commit
1202d9d492
@ -1082,10 +1082,12 @@ Var
|
||||
{$ifdef USE_STATX}
|
||||
Infox : TStatx;
|
||||
{$endif USE_STATX}
|
||||
Char0 : char;
|
||||
begin
|
||||
Result:=-1;
|
||||
{$ifdef USE_STATX}
|
||||
if statx(Handle,nil,0,STATX_MTIME,Infox)=0 then
|
||||
Char0:=#0;
|
||||
if statx(Handle,@Char0,AT_EMPTY_PATH,STATX_MTIME,Infox)=0 then
|
||||
Result:=Infox.stx_Mtime.tv_sec
|
||||
else if fpgeterrno=ESysENOSYS then
|
||||
{$endif USE_STATX}
|
||||
|
@ -39,6 +39,12 @@ BEGIN
|
||||
do_error(1003);
|
||||
Close(f);
|
||||
|
||||
Assign(f,'datetest.dat');
|
||||
Reset(f);
|
||||
if FileGetDate(filerec(f).handle)<>DateTimeToFileDate(dateTime) then
|
||||
do_error(1004);
|
||||
Close(f);
|
||||
|
||||
if FileExists('datetest.dat') then
|
||||
begin
|
||||
Assign(f,'datetest.dat');
|
||||
|
Loading…
Reference in New Issue
Block a user