mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 04:29:29 +02:00
+ also implemented FileSetDate(FileName) for WASI, via the __wasi_path_filestat_set_times API call
This commit is contained in:
parent
94d8c22c6a
commit
068f781c7a
@ -28,6 +28,7 @@ interface
|
||||
uses
|
||||
wasiapi;
|
||||
|
||||
{$DEFINE OS_FILESETDATEBYNAME}
|
||||
{$DEFINE HAS_SLEEP}
|
||||
{$DEFINE HAS_GETTICKCOUNT64}
|
||||
|
||||
@ -481,6 +482,24 @@ begin
|
||||
end;
|
||||
|
||||
|
||||
Function FileSetDate (Const FileName : RawByteString; Age : Int64) : Longint;
|
||||
var
|
||||
pr: RawByteString;
|
||||
fd: __wasi_fd_t;
|
||||
begin
|
||||
if not ConvertToFdRelativePath(FileName,fd,pr) then
|
||||
begin
|
||||
result:=-1;
|
||||
exit;
|
||||
end;
|
||||
if __wasi_path_filestat_set_times(fd,0,PChar(pr),length(pr),Age*1000000000,Age*1000000000,
|
||||
__WASI_FSTFLAGS_MTIM or __WASI_FSTFLAGS_ATIM)=__WASI_ERRNO_SUCCESS then
|
||||
result:=0
|
||||
else
|
||||
result:=-1;
|
||||
end;
|
||||
|
||||
|
||||
Function FileGetAttr (Const FileName : RawByteString) : Longint;
|
||||
begin
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user