+ implemented SysUtils.DeleteFile for WASI

This commit is contained in:
Nikolay Nikolov 2021-10-11 11:27:57 +03:00
parent c8d5bd77a3
commit 2a93340bcc

View File

@ -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;