mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-19 23:19:24 +02:00
+ implemented SysUtils.DeleteFile for WASI
This commit is contained in:
parent
c8d5bd77a3
commit
2a93340bcc
@ -344,7 +344,17 @@ end;
|
||||
|
||||
|
||||
Function DeleteFile (Const FileName : RawByteString) : Boolean;
|
||||
var
|
||||
fd: __wasi_fd_t;
|
||||
pr: RawByteString;
|
||||
res: __wasi_errno_t;
|
||||
begin
|
||||
if not ConvertToFdRelativePath(FileName,fd,pr) then
|
||||
begin
|
||||
result:=false;
|
||||
exit;
|
||||
end;
|
||||
result:=__wasi_path_unlink_file(fd,PChar(pr),Length(pr))=__WASI_ERRNO_SUCCESS;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user