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
+17 -5
View File
@@ -1,9 +1,21 @@
dir_remove
:sig
bool dir_remove(String path, bool recursive = false)
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
path : directory to remove
recursive : when true, remove the directory and everything inside it
return value : true on success
:content
Removes a directory. By default it must be empty; pass `recursive = true` to delete the directory and all of its contents.
:example
mkdir("/tmp/doc-rmdir");
file_put_contents("/tmp/doc-rmdir/child.txt", "x");
dir_remove("/tmp/doc-rmdir", true);
print(file_stat("/tmp/doc-rmdir")["exists"].to_bool() ? "still there" : "removed", "\n");
:see
>sys
:example
print("dir_remove example\n");
mkdir
file_unlink