mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 06:29:16 +02:00
* statx based Sysutils.FileGetDate with handle fixed
+ test git-svn-id: trunk@48520 -
This commit is contained in:
parent
b08717fef6
commit
3e453f92fc
@ -1082,10 +1082,12 @@ Var
|
|||||||
{$ifdef USE_STATX}
|
{$ifdef USE_STATX}
|
||||||
Infox : TStatx;
|
Infox : TStatx;
|
||||||
{$endif USE_STATX}
|
{$endif USE_STATX}
|
||||||
|
Char0 : char;
|
||||||
begin
|
begin
|
||||||
Result:=-1;
|
Result:=-1;
|
||||||
{$ifdef USE_STATX}
|
{$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
|
Result:=Infox.stx_Mtime.tv_sec
|
||||||
else if fpgeterrno=ESysENOSYS then
|
else if fpgeterrno=ESysENOSYS then
|
||||||
{$endif USE_STATX}
|
{$endif USE_STATX}
|
||||||
|
@ -39,6 +39,12 @@ BEGIN
|
|||||||
do_error(1003);
|
do_error(1003);
|
||||||
Close(f);
|
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
|
if FileExists('datetest.dat') then
|
||||||
begin
|
begin
|
||||||
Assign(f,'datetest.dat');
|
Assign(f,'datetest.dat');
|
||||||
|
Loading…
Reference in New Issue
Block a user