Capy-Bearer Documentation

file_write

host call

Capy

function file_write(handle : u64, value : string) u64

Description

file_write writes bytes at the current handle position. It advances the position.

Parameters

handle : writable handle from file_open

value : bytes to write

Return Values

The number of bytes written.

Example

Capy

var handle := file_open("/tmp/doc-write.txt", "w")
var count := file_write(handle, "hello")
file_close(handle)
print(count, " ", file_get_contents("/tmp/doc-write.txt"), "\n")