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_temp
:sig
String file_temp(String prefix)
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
prefix : path prefix for the temp file; a unique suffix is appended
return value : the path of the newly created temp file, or "" on failure
:content
Creates a new, uniquely named empty file using `prefix` as the leading path and returns its full path. Use it for scratch files and the write-then-rename publish pattern.
:example
String path = file_temp("/tmp/doc-temp-");
file_put_contents(path, "scratch");
print(str_starts_with(path, "/tmp/doc-temp-") ? "created a temp file" : path, "\n");
file_unlink(path);
:see
>sys
:example
print("file_temp example\n");
file_rename
file_put_contents