cleanup, docs
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user