mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-18 21:09:07 +02:00
+ implemented SysUtils.FileGetAttr for WASI
This commit is contained in:
parent
7f7c5785fc
commit
00aa7b8ab3
@ -592,7 +592,20 @@ end;
|
|||||||
|
|
||||||
|
|
||||||
Function FileGetAttr (Const FileName : RawByteString) : Longint;
|
Function FileGetAttr (Const FileName : RawByteString) : Longint;
|
||||||
|
var
|
||||||
|
pr: RawByteString;
|
||||||
|
fd: __wasi_fd_t;
|
||||||
|
Info: __wasi_filestat_t;
|
||||||
begin
|
begin
|
||||||
|
if ConvertToFdRelativePath(FileName,fd,pr)<>0 then
|
||||||
|
begin
|
||||||
|
result:=-1;
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
if __wasi_path_filestat_get(fd,0,PChar(pr),length(pr),@Info)=__WASI_ERRNO_SUCCESS then
|
||||||
|
result:=WasiToWinAttr(FileName,fd,PChar(pr),length(pr),Info)
|
||||||
|
else
|
||||||
|
result:=-1;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user