mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 01:09:31 +02:00
+ implemented SysUtils.RenameFile for WASI
This commit is contained in:
parent
4c89eaa6cf
commit
05c6937fd9
@ -353,7 +353,17 @@ end;
|
||||
|
||||
|
||||
Function RenameFile (Const OldName, NewName : RawByteString) : Boolean;
|
||||
var
|
||||
fd1,fd2: __wasi_fd_t;
|
||||
pr1,pr2: RawByteString;
|
||||
res: __wasi_errno_t;
|
||||
begin
|
||||
result:=false;
|
||||
if not ConvertToFdRelativePath(OldName,fd1,pr1) then
|
||||
exit;
|
||||
if not ConvertToFdRelativePath(NewName,fd2,pr2) then
|
||||
exit;
|
||||
result:=__wasi_path_rename(fd1,PChar(pr1),Length(pr1),fd2,PChar(pr2),Length(pr2))=__WASI_ERRNO_SUCCESS;
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user