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