cleanup, docs
This commit is contained in:
@@ -1,9 +1,20 @@
|
||||
file_copy
|
||||
:sig
|
||||
bool file_copy(String from, String to)
|
||||
|
||||
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
|
||||
from : source path
|
||||
to : destination path (overwritten if it exists)
|
||||
return value : true on success
|
||||
|
||||
:content
|
||||
Copies a file's contents to a new path, overwriting the destination if present.
|
||||
|
||||
:example
|
||||
file_put_contents("/tmp/doc-copy-src.txt", "payload");
|
||||
file_copy("/tmp/doc-copy-src.txt", "/tmp/doc-copy-dst.txt");
|
||||
print(file_get_contents("/tmp/doc-copy-dst.txt"), "\n");
|
||||
|
||||
:see
|
||||
>sys
|
||||
|
||||
:example
|
||||
print("file_copy example\n");
|
||||
file_rename
|
||||
file_put_contents
|
||||
|
||||
Reference in New Issue
Block a user