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
+15 -5
View File
@@ -1,9 +1,19 @@
file_chmod
:sig
bool file_chmod(String path, u32 mode)
Filesystem nicety added to the wasm host membrane. Path arguments are policy-gated; operations return an empty value or false on denial/error. file_fsync() takes an open file handle and flushes it with fsync().
:params
path : file or directory to change
mode : permission bits, e.g. 0644 or 0600 (octal)
return value : true on success
:content
Sets a path's permission bits, like the shell `chmod`. Pass the mode as an octal literal such as `0600`.
:example
file_put_contents("/tmp/doc-chmod.txt", "secret");
print(file_chmod("/tmp/doc-chmod.txt", 0600) ? "mode set" : "failed", "\n");
:see
>sys
:example
print("file_chmod example\n");
file_stat
file_put_contents