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_fsync
:sig
bool file_fsync(u64 h)
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
h : handle from file_open() opened for writing
return value : true if the flush succeeded
:content
Flushes a handle's buffered writes to disk, so the data survives a crash or power loss. Call it before `file_close()` when durability matters (e.g. after writing a checkpoint).
:example
u64 h = file_open("/tmp/doc-fsync.txt", "w");
file_write(h, "durable");
print(file_fsync(h) ? "flushed to disk" : "fsync failed", "\n");
file_close(h);
:see
>sys
:example
print("file_fsync example\n");
file_write
file_close