cleanup, docs

This commit is contained in:
root
2026-06-16 23:02:45 +00:00
parent ea08d5f28b
commit b8b56cf3dd
160 changed files with 1076 additions and 511 deletions
+16 -5
View File
@@ -1,9 +1,20 @@
file_rename
:sig
bool file_rename(String from, String to)
Structural filesystem operation across the wasm host membrane. All path arguments are policy-gated through the same guest file/write roots as other file APIs and return false on denial or OS error.
:params
from : source path
to : destination path
return value : true on success
:content
Renames or moves a file. After a successful rename the source path no longer exists. Use it for atomic publish patterns: write a temp file, then rename it into place.
:example
file_put_contents("/tmp/doc-rename-a.txt", "moved");
file_rename("/tmp/doc-rename-a.txt", "/tmp/doc-rename-b.txt");
print(file_get_contents("/tmp/doc-rename-b.txt"), " / source ", file_exists("/tmp/doc-rename-a.txt") ? "exists" : "gone", "\n");
:see
>sys
:example
print("file_rename example\n");
file_copy
file_temp