EgretDoc
Back to Home
Location:system/fs

Module

Module documentation.

modulefs

Classes

Classes and inheritance.

classfs::FileInfo
@brief`FileInfo` type.
@details`FileInfo` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class FileInfo {
    /*
    @brief `name` field.
classfs::File
@brief`File` type.
@details`File` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class FileInfo {
    /*
    @brief `name` field.
classfs::Stream
@brief`Stream` type.
@details`Stream` encapsulates state and operations exported by the system module. It commonly stores runtime handles, protocol state, buffers, configuration, or collection data. Its methods define the primary behavior for the type. If the type owns external resources, prefer `dispose` or `close` for deterministic release.
class Stream {
    /*
    @brief `h` field.

Functions

Free functions and class methods.

functionfs::__file_exists
Signatureextern func __file_exists(path: String) -> Int;
extern func __file_exists(path: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_remove`.
@briefBinds the low-level runtime symbol `__file_exists`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
@returnReturns the operation result as `Int`.
functionfs::__file_remove
Signatureextern func __file_remove(path: String) -> Int;
extern func __file_remove(path: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_write_text`.
@briefBinds the low-level runtime symbol `__file_remove`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
@returnReturns the operation result as `Int`.
functionfs::__file_write_text
Signatureextern func __file_write_text(path: String, data: String) -> Int;
extern func __file_write_text(path: String, data: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_read_text`.
@briefBinds the low-level runtime symbol `__file_write_text`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
  • dataInput or output data buffer.
@returnReturns the operation result as `Int`.
functionfs::__file_read_text
Signatureextern func __file_read_text(path: String) -> String;
extern func __file_read_text(path: String) -> String;
/*
@brief Binds the low-level runtime symbol `__file_read_bytes`.
@briefBinds the low-level runtime symbol `__file_read_text`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
@returnReturns the operation result as `String`.
functionfs::__file_read_bytes
Signatureextern func __file_read_bytes(path: String, max_bytes: Int) -> String;
extern func __file_read_bytes(path: String, max_bytes: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__file_write_bytes`.
@briefBinds the low-level runtime symbol `__file_read_bytes`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
  • max_bytesMaximum number of bytes to read or process in this operation.
@returnReturns the operation result as `String`.
functionfs::__file_write_bytes
Signatureextern func __file_write_bytes(path: String, data: String) -> Int;
extern func __file_write_bytes(path: String, data: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_read_path_at`.
@briefBinds the low-level runtime symbol `__file_write_bytes`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
  • dataInput or output data buffer.
@returnReturns the operation result as `Int`.
functionfs::__file_read_path_at
Signatureextern func __file_read_path_at(path: String, offset: Int, max_bytes: Int) -> String;
extern func __file_read_path_at(path: String, offset: Int, max_bytes: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__file_write_path_at`.
@briefBinds the low-level runtime symbol `__file_read_path_at`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
  • offsetByte offset measured from the start position.
  • max_bytesMaximum number of bytes to read or process in this operation.
@returnReturns the operation result as `String`.
functionfs::__file_write_path_at
Signatureextern func __file_write_path_at(path: String, offset: Int, data: String) -> Int;
extern func __file_write_path_at(path: String, offset: Int, data: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_open`.
@briefBinds the low-level runtime symbol `__file_write_path_at`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
  • offsetByte offset measured from the start position.
  • dataInput or output data buffer.
@returnReturns the operation result as `Int`.
functionfs::__file_open
Signatureextern func __file_open(path: String, flags: Int, mode: Int) -> Int;
extern func __file_open(path: String, flags: Int, mode: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_handle_read_at`.
@briefBinds the low-level runtime symbol `__file_open`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
  • flagsBitmask of option flags that controls how the operation is performed.
  • modeMode value that selects permissions, behavior, or formatting rules for the operation.
@returnReturns the operation result as `Int`.
functionfs::__file_handle_read_at
Signatureextern func __file_handle_read_at(h: Int, offset: Int, max_bytes: Int) -> String;
extern func __file_handle_read_at(h: Int, offset: Int, max_bytes: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__file_handle_write_at`.
@briefBinds the low-level runtime symbol `__file_handle_read_at`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • hUnderlying runtime handle.
  • offsetByte offset measured from the start position.
  • max_bytesMaximum number of bytes to read or process in this operation.
@returnReturns the operation result as `String`.
functionfs::__file_handle_write_at
Signatureextern func __file_handle_write_at(h: Int, offset: Int, data: String) -> Int;
extern func __file_handle_write_at(h: Int, offset: Int, data: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_handle_read_raw`.
@briefBinds the low-level runtime symbol `__file_handle_write_at`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • hUnderlying runtime handle.
  • offsetByte offset measured from the start position.
  • dataInput or output data buffer.
@returnReturns the operation result as `Int`.
functionfs::__file_handle_read_raw
Signatureextern func __file_handle_read_raw(h: Int, max_bytes: Int) -> String;
extern func __file_handle_read_raw(h: Int, max_bytes: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__file_handle_write_raw`.
@briefBinds the low-level runtime symbol `__file_handle_read_raw`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • hUnderlying runtime handle.
  • max_bytesMaximum number of bytes to read or process in this operation.
@returnReturns the operation result as `String`.
functionfs::__file_handle_write_raw
Signatureextern func __file_handle_write_raw(h: Int, data: String) -> Int;
extern func __file_handle_write_raw(h: Int, data: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_handle_set_nonblock`.
@briefBinds the low-level runtime symbol `__file_handle_write_raw`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • hUnderlying runtime handle.
  • dataInput or output data buffer.
@returnReturns the operation result as `Int`.
functionfs::__file_handle_set_nonblock
Signatureextern func __file_handle_set_nonblock(h: Int) -> Int;
extern func __file_handle_set_nonblock(h: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_from_fd`.
@briefBinds the low-level runtime symbol `__file_handle_set_nonblock`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • hUnderlying runtime handle.
@returnReturns the operation result as `Int`.
functionfs::__file_from_fd
Signatureextern func __file_from_fd(fd: Int, path: String, flags: Int) -> Int;
extern func __file_from_fd(fd: Int, path: String, flags: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_ioctl`.
@briefBinds the low-level runtime symbol `__file_from_fd`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • fdOperating-system file descriptor or socket descriptor.
  • pathFile or directory path.
  • flagsBitmask of option flags that controls how the operation is performed.
@returnReturns the operation result as `Int`.
functionfs::__file_ioctl
Signatureextern func __file_ioctl(h: Int, request: Int, data: String) -> Int;
extern func __file_ioctl(h: Int, request: Int, data: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_fsync`.
@briefBinds the low-level runtime symbol `__file_ioctl`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • hUnderlying runtime handle.
  • requestRequest object, request id, or encoded request payload to process.
  • dataInput or output data buffer.
@returnReturns the operation result as `Int`.
functionfs::__file_fsync
Signatureextern func __file_fsync(h: Int) -> Int;
extern func __file_fsync(h: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_handle_close`.
@briefBinds the low-level runtime symbol `__file_fsync`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • hUnderlying runtime handle.
@returnReturns the operation result as `Int`.
functionfs::__file_handle_close
Signatureextern func __file_handle_close(h: Int) -> Int;
extern func __file_handle_close(h: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_copy`.
@briefBinds the low-level runtime symbol `__file_handle_close`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • hUnderlying runtime handle.
@returnReturns the operation result as `Int`.
functionfs::__file_copy
Signatureextern func __file_copy(from: String, to: String) -> Int;
extern func __file_copy(from: String, to: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_watch_once`.
@briefBinds the low-level runtime symbol `__file_copy`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • fromSource endpoint, path, index, or lower boundary for the operation.
  • toDestination endpoint, path, index, or upper boundary for the operation.
@returnReturns the operation result as `Int`.
functionfs::__file_watch_once
Signatureextern func __file_watch_once(path: String, timeout_ms: Int) -> Int;
extern func __file_watch_once(path: String, timeout_ms: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_queue_len`.
@briefBinds the low-level runtime symbol `__file_watch_once`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnReturns the operation result as `Int`.
functionfs::__file_queue_len
Signatureextern func __file_queue_len() -> Int;
extern func __file_queue_len() -> Int;
/*
@brief Binds the low-level runtime symbol `__file_active_count`.
@briefBinds the low-level runtime symbol `__file_queue_len`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@returnReturns the operation result as `Int`.
functionfs::__file_active_count
Signatureextern func __file_active_count() -> Int;
extern func __file_active_count() -> Int;
/*
@brief Binds the low-level runtime symbol `__file_max_queue`.
@briefBinds the low-level runtime symbol `__file_active_count`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@returnReturns the operation result as `Int`.
functionfs::__file_max_queue
Signatureextern func __file_max_queue() -> Int;
extern func __file_max_queue() -> Int;
/*
@brief Binds the low-level runtime symbol `__file_shutdown`.
@briefBinds the low-level runtime symbol `__file_max_queue`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@returnReturns the operation result as `Int`.
functionfs::__file_shutdown
Signatureextern func __file_shutdown() -> Void;
extern func __file_shutdown() -> Void;
/*
@brief Binds the low-level runtime symbol `__file_open_read`.
@briefBinds the low-level runtime symbol `__file_shutdown`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@returnVoid
functionfs::__file_open_read
Signatureextern func __file_open_read(path: String) -> Int;
extern func __file_open_read(path: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__file_read_line`.
@briefBinds the low-level runtime symbol `__file_open_read`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
@returnReturns the operation result as `Int`.
functionfs::__file_read_line
Signatureextern func __file_read_line(handle: Int) -> String;
extern func __file_read_line(handle: Int) -> String;
/*
@brief Binds the low-level runtime symbol `__file_close`.
@briefBinds the low-level runtime symbol `__file_read_line`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • handleUnderlying runtime handle.
@returnReturns the operation result as `String`.
functionfs::__file_close
Signatureextern func __file_close(handle: Int) -> Int;
extern func __file_close(handle: Int) -> Int;
/*
@brief Binds the low-level runtime symbol `__os_mkdir`.
@briefBinds the low-level runtime symbol `__file_close`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • handleUnderlying runtime handle.
@returnReturns the operation result as `Int`.
functionfs::__os_mkdir
Signatureextern func __os_mkdir(path: String) -> Int;
extern func __os_mkdir(path: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__os_mkdir_all`.
@briefBinds the low-level runtime symbol `__os_mkdir`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
@returnReturns the operation result as `Int`.
functionfs::__os_mkdir_all
Signatureextern func __os_mkdir_all(path: String) -> Int;
extern func __os_mkdir_all(path: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__os_rename`.
@briefBinds the low-level runtime symbol `__os_mkdir_all`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
@returnReturns the operation result as `Int`.
functionfs::__os_rename
Signatureextern func __os_rename(oldpath: String, newpath: String) -> Int;
extern func __os_rename(oldpath: String, newpath: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__os_getwd`.
@briefBinds the low-level runtime symbol `__os_rename`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • oldpathFilesystem path or file-related value used by the operation.
  • newpathFilesystem path or file-related value used by the operation.
@returnReturns the operation result as `Int`.
functionfs::__os_getwd
Signatureextern func __os_getwd() -> String;
extern func __os_getwd() -> String;
/*
@brief Binds the low-level runtime symbol `__os_chdir`.
@briefBinds the low-level runtime symbol `__os_getwd`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@returnReturns the operation result as `String`.
functionfs::__os_chdir
Signatureextern func __os_chdir(path: String) -> Int;
extern func __os_chdir(path: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__os_temp_dir`.
@briefBinds the low-level runtime symbol `__os_chdir`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
@returnReturns the operation result as `Int`.
functionfs::__os_temp_dir
Signatureextern func __os_temp_dir() -> String;
extern func __os_temp_dir() -> String;
/*
@brief Binds the low-level runtime symbol `__os_stat_size`.
@briefBinds the low-level runtime symbol `__os_temp_dir`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@returnReturns the operation result as `String`.
functionfs::__os_stat_size
Signatureextern func __os_stat_size(path: String) -> Int;
extern func __os_stat_size(path: String) -> Int;
/*
@brief Binds the low-level runtime symbol `__os_stat_is_dir`.
@briefBinds the low-level runtime symbol `__os_stat_size`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
@returnReturns the operation result as `Int`.
functionfs::__os_stat_is_dir
Signatureextern func __os_stat_is_dir(path: String) -> Int;
extern func __os_stat_is_dir(path: String) -> Int;

/*
@briefBinds the low-level runtime symbol `__os_stat_is_dir`.
@detailsThis function is an external entry point used by system modules to access native runtime capabilities such as filesystem, networking, threading, GC, cryptography, or platform operations. Prefer the safe wrapper functions in the same file when available. When calling this entry directly, pass validated arguments that match the signature and handle failures according to the return-value convention.
@param
  • pathFile or directory path.
@returnReturns the operation result as `Int`.
functionfs::file_exists
Signaturefunc file_exists(path: String) -> Bool
func file_exists(path: String) -> Bool {
    return __file_exists(path) == 1;
}
@briefProvides the system library operation `file_exists`.
@detailsExecutes the `file_exists` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionfs::file_remove
Signaturefunc file_remove(path: String) -> Bool
func file_remove(path: String) -> Bool {
    return __file_remove(path) == 1;
}
@briefProvides the system library operation `file_remove`.
@detailsExecutes the `file_remove` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionfs::file_write_text
Signaturefunc file_write_text(path: String, data: String) -> Bool
func file_write_text(path: String, data: String) -> Bool {
    return __file_write_text(path, data) == 1;
}
@briefProvides the system library operation `file_write_text`.
@detailsExecutes the `file_write_text` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
  • dataInput or output data buffer.
@returnReturns a boolean result; true means the condition holds or the operation succeeded.
functionfs::file_read_text
Signaturefunc file_read_text(path: String) -> String
func file_read_text(path: String) -> String {
    return __file_read_text(path);
}
@briefProvides the system library operation `file_read_text`.
@detailsExecutes the `file_read_text` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns the operation result as `String`.
functionfs::file_open_read
Signaturefunc file_open_read(path: String) -> Int
func file_open_read(path: String) -> Int {
    return __file_open_read(path);
}
@briefProvides the system library operation `file_open_read`.
@detailsExecutes the `file_open_read` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns the operation result as `Int`.
functionfs::file_read_line
Signaturefunc file_read_line(handle: Int) -> String
func file_read_line(handle: Int) -> String {
    return __file_read_line(handle);
}
@briefProvides the system library operation `file_read_line`.
@detailsExecutes the `file_read_line` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • handleUnderlying runtime handle.
@returnReturns the operation result as `String`.
functionfs::flag_read
Signaturefunc flag_read() -> Int
func flag_read() -> Int {
    return 1;
}
@briefProvides the system library operation `flag_read`.
@detailsExecutes the `flag_read` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionfs::flag_write
Signaturefunc flag_write() -> Int
func flag_write() -> Int {
    return 2;
}
@briefProvides the system library operation `flag_write`.
@detailsExecutes the `flag_write` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionfs::flag_create
Signaturefunc flag_create() -> Int
func flag_create() -> Int {
    return 4;
}
@briefProvides the system library operation `flag_create`.
@detailsExecutes the `flag_create` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionfs::flag_trunc
Signaturefunc flag_trunc() -> Int
func flag_trunc() -> Int {
    return 8;
}
@briefProvides the system library operation `flag_trunc`.
@detailsExecutes the `flag_trunc` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionfs::flag_append
Signaturefunc flag_append() -> Int
func flag_append() -> Int {
    return 16;
}
@briefProvides the system library operation `flag_append`.
@detailsExecutes the `flag_append` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionfs::FileInfo.init
Signaturefunc init(self: fs.FileInfo) -> Void
    func init(self: fs.FileInfo) -> Void {
        self.name = "";
        self.size = 0;
@briefInitializes a `FileInfo` instance.
@detailsEstablishes the initial field state for `FileInfo` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionfs::FileInfo.deinit
Signaturefunc deinit(self: fs.FileInfo) -> Void
    func deinit(self: fs.FileInfo) -> Void {
    }
}
@briefReleases fallback resources at the end of the `FileInfo` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionfs::File.init
Signaturefunc init(self: File, path: String = "", h: Int = 0, owns_handle: Bool = false) -> Void
    func init(self: File, path: String = "", h: Int = 0, owns_handle: Bool = false) -> Void {
        self.path = path;
        self.h = h;
@briefInitializes a `File` instance.
@detailsEstablishes the initial field state for `File` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
  • pathFile or directory path.
  • hUnderlying runtime handle.
  • owns_handleWhether the object owns the native handle and must release it during cleanup.
@returnVoid
functionfs::File.deinit
Signaturefunc deinit(self: File) -> Void
    func deinit(self: File) -> Void {
        if self.owns_handle && !self.closed && self.h != 0 {
            _ = fs.close(self.h);
@briefReleases fallback resources at the end of the `File` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionfs::File.read
Signaturefunc read(self: File, max_bytes: Int) -> bytes.Bytes, ErrCode
    func read(self: File, max_bytes: Int) -> bytes.Bytes, ErrCode {
        if self.closed {
            return "", std.ERR_INVALID;
@briefReads data with `File.read`.
@detailsExecutes the `read` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
  • max_bytesMaximum number of bytes to read or process in this operation.
@returnReturns `bytes.Bytes, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::File.read_all
Signaturefunc read_all(self: File) -> bytes.Bytes, ErrCode
    func read_all(self: File) -> bytes.Bytes, ErrCode {
        if self.closed {
            return "", std.ERR_INVALID;
@briefReads all available data with `File.read_all`.
@detailsExecutes the `read_all` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns `bytes.Bytes, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::File.write
Signaturefunc write(self: File, data: bytes.Bytes) -> Int, ErrCode
    func write(self: File, data: bytes.Bytes) -> Int, ErrCode {
        if self.closed {
            return 0, std.ERR_INVALID;
@briefWrites data with `File.write`.
@detailsExecutes the `write` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
  • dataInput or output data buffer.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::File.close
Signaturefunc close(self: File) -> ErrCode
    func close(self: File) -> ErrCode {
        if self.closed {
            return std.OK;
@briefCloses resources and makes later operations unavailable with `File.close`.
@detailsExecutes the `close` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnReturns `ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::File.dispose
Signaturefunc dispose(self: File) -> Void
    func dispose(self: File) -> Void {
        _ = self.close();
    }
@briefExplicitly releases resources owned by `File`.
@detailsThis method deterministically cleans up file descriptors, network connections, native handles, buffers, or other external resources. Implementations should be idempotent where possible, and repeated calls must not corrupt object state.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionfs::Stream.init
Signaturefunc init(self: fs.Stream) -> Void
    func init(self: fs.Stream) -> Void {
        self.h = 0;
        self.offset = 0;
@briefInitializes a `Stream` instance.
@detailsEstablishes the initial field state for `Stream` so other methods can be called safely. Constructor logic should keep fields consistent and avoid leaking partially initialized resources.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionfs::Stream.deinit
Signaturefunc deinit(self: fs.Stream) -> Void
    func deinit(self: fs.Stream) -> Void {
        if self.owns_handle && !self.closed && self.h != 0 {
            _ = fs.stream_close(self);
@briefReleases fallback resources at the end of the `Stream` lifetime.
@detailsThis destructor hook is called by object lifetime management to clean up underlying resources that were not released explicitly. Normal application code should prefer `dispose`, `close`, or the module-specific close function to release resources at a deterministic time.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionfs::Stream.dispose
Signaturefunc dispose(self: fs.Stream) -> Void
    func dispose(self: fs.Stream) -> Void {
        _ = fs.stream_close(self);
    }
@briefExplicitly releases resources owned by `Stream`.
@detailsThis method deterministically cleans up file descriptors, network connections, native handles, buffers, or other external resources. Implementations should be idempotent where possible, and repeated calls must not corrupt object state.
@param
  • selfThe current instance whose fields, handles, buffers, or external resources are read or modified by this method.
@returnVoid
functionfs::open
Signaturefunc open(path: String, flags: Int = 1, mode: Int = 420) -> Int, ErrCode
func open(path: String, flags: Int = 1, mode: Int = 420) -> Int, ErrCode {
    let h: Int = __file_open(path, flags, mode);
    if h != 0 {
@briefProvides the system library operation `open`.
@detailsExecutes the `open` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
  • flagsBitmask of option flags that controls how the operation is performed.
  • modeMode value that selects permissions, behavior, or formatting rules for the operation.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::open_file
Signaturefunc open_file(path: String, flags: Int = 1, mode: Int = 420) -> fs.File, ErrCode
func open_file(path: String, flags: Int = 1, mode: Int = 420) -> fs.File, ErrCode {
    let h: Int = open(path, flags, mode)?;
    return new File(path, h, true), std.OK;
@briefOpens a resource with `open_file`.
@detailsExecutes the `open_file` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
  • flagsBitmask of option flags that controls how the operation is performed.
  • modeMode value that selects permissions, behavior, or formatting rules for the operation.
@returnReturns `fs.File, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::create
Signaturefunc create(path: String) -> File, ErrCode
func create(path: String) -> File, ErrCode {
    return open_file(path, 1 + 2 + 4 + 8, 420);
}
@briefProvides the system library operation `create`.
@detailsExecutes the `create` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns `File, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::read_text
Signaturefunc read_text(path: String) -> String, ErrCode
func read_text(path: String) -> String, ErrCode {
    if __file_exists(path) != 1 {
        return "", std.ERR_NOT_FOUND;
@briefReads data with `read_text`.
@detailsExecutes the `read_text` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns `String, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::read_bytes
Signaturefunc read_bytes(path: String, max_bytes: Int) -> bytes.Bytes, ErrCode
func read_bytes(path: String, max_bytes: Int) -> bytes.Bytes, ErrCode {
    if __file_exists(path) != 1 {
        return "", std.ERR_NOT_FOUND;
@briefReads data with `read_bytes`.
@detailsExecutes the `read_bytes` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
  • max_bytesMaximum number of bytes to read or process in this operation.
@returnReturns `bytes.Bytes, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::write_text
Signaturefunc write_text(path: String, data: String) -> Int, ErrCode
func write_text(path: String, data: String) -> Int, ErrCode {
    if __file_write_text(path, data) == 1 {
        return std.len(data), std.OK;
@briefWrites data with `write_text`.
@detailsExecutes the `write_text` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
  • dataInput or output data buffer.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::write_bytes
Signaturefunc write_bytes(path: String, data: bytes.Bytes) -> Int, ErrCode
func write_bytes(path: String, data: bytes.Bytes) -> Int, ErrCode {
    if __file_write_bytes(path, data) == 1 {
        return bytes.len(data), std.OK;
@briefWrites data with `write_bytes`.
@detailsExecutes the `write_bytes` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
  • dataInput or output data buffer.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::read_path_at
Signaturefunc read_path_at(path: String, offset: Int, max_bytes: Int) -> bytes.Bytes, ErrCode
func read_path_at(path: String, offset: Int, max_bytes: Int) -> bytes.Bytes, ErrCode {
    if offset < 0 {
        return "", std.ERR_INVALID;
@briefReads data with `read_path_at`.
@detailsExecutes the `read_path_at` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
  • offsetByte offset measured from the start position.
  • max_bytesMaximum number of bytes to read or process in this operation.
@returnReturns `bytes.Bytes, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::write_path_at
Signaturefunc write_path_at(path: String, offset: Int, data: bytes.Bytes) -> Int, ErrCode
func write_path_at(path: String, offset: Int, data: bytes.Bytes) -> Int, ErrCode {
    if offset < 0 {
        return 0, std.ERR_INVALID;
@briefWrites data with `write_path_at`.
@detailsExecutes the `write_path_at` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
  • offsetByte offset measured from the start position.
  • dataInput or output data buffer.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::read_at
Signaturefunc read_at(h: Int, offset: Int, max_bytes: Int) -> bytes.Bytes, ErrCode
func read_at(h: Int, offset: Int, max_bytes: Int) -> bytes.Bytes, ErrCode {
    if h == 0 || offset < 0 {
        return "", std.ERR_INVALID;
@briefReads data with `read_at`.
@detailsExecutes the `read_at` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hUnderlying runtime handle.
  • offsetByte offset measured from the start position.
  • max_bytesMaximum number of bytes to read or process in this operation.
@returnReturns `bytes.Bytes, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::write_at
Signaturefunc write_at(h: Int, offset: Int, data: bytes.Bytes) -> Int, ErrCode
func write_at(h: Int, offset: Int, data: bytes.Bytes) -> Int, ErrCode {
    if h == 0 || offset < 0 {
        return 0, std.ERR_INVALID;
@briefWrites data with `write_at`.
@detailsExecutes the `write_at` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hUnderlying runtime handle.
  • offsetByte offset measured from the start position.
  • dataInput or output data buffer.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::read_raw
Signaturefunc read_raw(h: Int, max_bytes: Int) -> bytes.Bytes, ErrCode
func read_raw(h: Int, max_bytes: Int) -> bytes.Bytes, ErrCode {
    if h == 0 {
        return "", std.ERR_INVALID;
@briefReads data with `read_raw`.
@detailsExecutes the `read_raw` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hUnderlying runtime handle.
  • max_bytesMaximum number of bytes to read or process in this operation.
@returnReturns `bytes.Bytes, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::write_raw
Signaturefunc write_raw(h: Int, data: bytes.Bytes) -> Int, ErrCode
func write_raw(h: Int, data: bytes.Bytes) -> Int, ErrCode {
    if h == 0 {
        return 0, std.ERR_INVALID;
@briefWrites data with `write_raw`.
@detailsExecutes the `write_raw` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hUnderlying runtime handle.
  • dataInput or output data buffer.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::set_nonblock
Signaturefunc set_nonblock(h: Int) -> ErrCode
func set_nonblock(h: Int) -> ErrCode {
    if h == 0 {
        return std.ERR_INVALID;
@briefSets state or configuration with `set_nonblock`.
@detailsExecutes the `set_nonblock` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hUnderlying runtime handle.
@returnReturns `ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::file_from_fd
Signaturefunc file_from_fd(fd: Int, path: String = "", flags: Int = 3) -> fs.File, ErrCode
func file_from_fd(fd: Int, path: String = "", flags: Int = 3) -> fs.File, ErrCode {
    if fd < 0 {
        return new fs.File(), std.ERR_INVALID;
@briefProvides the system library operation `file_from_fd`.
@detailsExecutes the `file_from_fd` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • fdOperating-system file descriptor or socket descriptor.
  • pathFile or directory path.
  • flagsBitmask of option flags that controls how the operation is performed.
@returnReturns `fs.File, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::ioctl
Signaturefunc ioctl(h: Int, request: Int, data: bytes.Bytes = "") -> Int, ErrCode
func ioctl(h: Int, request: Int, data: bytes.Bytes = "") -> Int, ErrCode {
    if h == 0 || request < 0 {
        return 0, std.ERR_INVALID;
@briefProvides the system library operation `ioctl`.
@detailsExecutes the `ioctl` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hUnderlying runtime handle.
  • requestRequest object, request id, or encoded request payload to process.
  • dataInput or output data buffer.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::fsync
Signaturefunc fsync(h: Int) -> Int, ErrCode
func fsync(h: Int) -> Int, ErrCode {
    if h == 0 {
        return 0, std.ERR_INVALID;
@briefProvides the system library operation `fsync`.
@detailsExecutes the `fsync` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hUnderlying runtime handle.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::close
Signaturefunc close(h: Int) -> Void
func close(h: Int) -> Void {
    if __file_handle_close(h) != 1 {
        _ = __file_close(h);
@briefCloses resources and makes later operations unavailable with `close`.
@detailsExecutes the `close` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hUnderlying runtime handle.
@returnVoid
functionfs::file_from_handle
Signaturefunc file_from_handle(h: Int) -> fs.File
func file_from_handle(h: Int) -> fs.File {
    return new fs.File("", h, false);
}
@briefProvides the system library operation `file_from_handle`.
@detailsExecutes the `file_from_handle` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hUnderlying runtime handle.
@returnReturns the operation result as `fs.File`.
functionfs::file_read
Signaturefunc file_read(f: fs.File, max_bytes: Int) -> bytes.Bytes, ErrCode
func file_read(f: fs.File, max_bytes: Int) -> bytes.Bytes, ErrCode {
    return f.read(max_bytes);
}
@briefProvides the system library operation `file_read`.
@detailsExecutes the `file_read` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • fFuture, callback, file handle, or function object that the operation observes or invokes.
  • max_bytesMaximum number of bytes to read or process in this operation.
@returnReturns `bytes.Bytes, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::file_write
Signaturefunc file_write(f: fs.File, data: bytes.Bytes) -> Int, ErrCode
func file_write(f: fs.File, data: bytes.Bytes) -> Int, ErrCode {
    return f.write(data);
}
@briefProvides the system library operation `file_write`.
@detailsExecutes the `file_write` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • fFuture, callback, file handle, or function object that the operation observes or invokes.
  • dataInput or output data buffer.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::file_close
Signaturefunc file_close(f: fs.File) -> ErrCode
func file_close(f: fs.File) -> ErrCode {
    return f.close();
}
@briefProvides the system library operation `file_close`.
@detailsExecutes the `file_close` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • fFuture, callback, file handle, or function object that the operation observes or invokes.
@returnReturns `ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::stream_from_handle
Signaturefunc stream_from_handle(h: Int, chunk_size: Int, owns_handle: Bool = false) -> fs.Stream
func stream_from_handle(h: Int, chunk_size: Int, owns_handle: Bool = false) -> fs.Stream {
    let s = new fs.Stream();
    s.h = h;
@briefProvides the system library operation `stream_from_handle`.
@detailsExecutes the `stream_from_handle` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hUnderlying runtime handle.
  • chunk_sizeSize or length value that limits how much data the operation processes.
  • owns_handleWhether the object owns the native handle and must release it during cleanup.
@returnReturns the operation result as `fs.Stream`.
functionfs::stream_read
Signaturefunc stream_read(s: fs.Stream) -> bytes.Bytes, ErrCode
func stream_read(s: fs.Stream) -> bytes.Bytes, ErrCode {
    if s.closed {
        return "", std.ERR_INVALID;
@briefProvides the system library operation `stream_read`.
@detailsExecutes the `stream_read` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
@returnReturns `bytes.Bytes, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::stream_write
Signaturefunc stream_write(s: fs.Stream, data: bytes.Bytes) -> Int, ErrCode
func stream_write(s: fs.Stream, data: bytes.Bytes) -> Int, ErrCode {
    if s.closed {
        return 0, std.ERR_INVALID;
@briefProvides the system library operation `stream_write`.
@detailsExecutes the `stream_write` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
  • dataInput or output data buffer.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::stream_close
Signaturefunc stream_close(s: fs.Stream) -> Void
func stream_close(s: fs.Stream) -> Void {
    if !s.closed && s.h != 0 && s.owns_handle {
        _ = fs.close(s.h);
@briefProvides the system library operation `stream_close`.
@detailsExecutes the `stream_close` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • sInput string.
@returnVoid
functionfs::remove
Signaturefunc remove(path: String) -> Int, ErrCode
func remove(path: String) -> Int, ErrCode {
    if __file_exists(path) != 1 {
        return 0, std.ERR_NOT_FOUND;
@briefRemoves an element or resource with `remove`.
@detailsExecutes the `remove` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::exists
Signaturefunc exists(path: String) -> Bool, ErrCode
func exists(path: String) -> Bool, ErrCode {
    return __file_exists(path) == 1, std.OK;
}
@briefProvides the system library operation `exists`.
@detailsExecutes the `exists` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns `Bool, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::mkdir
Signaturefunc mkdir(path: String) -> Int, ErrCode
func mkdir(path: String) -> Int, ErrCode {
    if __os_mkdir(path) == 1 {
        return 0, std.OK;
@briefProvides the system library operation `mkdir`.
@detailsExecutes the `mkdir` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::mkdir_all
Signaturefunc mkdir_all(path: String) -> Int, ErrCode
func mkdir_all(path: String) -> Int, ErrCode {
    if __os_mkdir_all(path) == 1 {
        return 0, std.OK;
@briefProvides the system library operation `mkdir_all`.
@detailsExecutes the `mkdir_all` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::rename
Signaturefunc rename(oldpath: String, newpath: String) -> Int, ErrCode
func rename(oldpath: String, newpath: String) -> Int, ErrCode {
    if __os_rename(oldpath, newpath) == 1 {
        return 0, std.OK;
@briefProvides the system library operation `rename`.
@detailsExecutes the `rename` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • oldpathFilesystem path or file-related value used by the operation.
  • newpathFilesystem path or file-related value used by the operation.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::copy
Signaturefunc copy(from: String, to: String) -> Int, ErrCode
func copy(from: String, to: String) -> Int, ErrCode {
    let n: Int = __file_copy(from, to);
    if n < 0 {
@briefProvides the system library operation `copy`.
@detailsExecutes the `copy` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • fromSource endpoint, path, index, or lower boundary for the operation.
  • toDestination endpoint, path, index, or upper boundary for the operation.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::getwd
Signaturefunc getwd() -> String, ErrCode
func getwd() -> String, ErrCode {
    let wd: String = __os_getwd();
    if std.len(wd) == 0 {
@briefProvides the system library operation `getwd`.
@detailsExecutes the `getwd` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns `String, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::chdir
Signaturefunc chdir(path: String) -> Int, ErrCode
func chdir(path: String) -> Int, ErrCode {
    if __os_chdir(path) == 1 {
        return 0, std.OK;
@briefProvides the system library operation `chdir`.
@detailsExecutes the `chdir` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::temp_dir
Signaturefunc temp_dir() -> String, ErrCode
func temp_dir() -> String, ErrCode {
    let d: String = __os_temp_dir();
    if std.len(d) == 0 {
@briefProvides the system library operation `temp_dir`.
@detailsExecutes the `temp_dir` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns `String, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::stat_size
Signaturefunc stat_size(path: String) -> Int, ErrCode
func stat_size(path: String) -> Int, ErrCode {
    let n: Int = __os_stat_size(path);
    if n < 0 {
@briefProvides the system library operation `stat_size`.
@detailsExecutes the `stat_size` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::stat_is_dir
Signaturefunc stat_is_dir(path: String) -> Bool, ErrCode
func stat_is_dir(path: String) -> Bool, ErrCode {
    let n: Int = __os_stat_is_dir(path);
    if n < 0 {
@briefProvides the system library operation `stat_is_dir`.
@detailsExecutes the `stat_is_dir` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns `Bool, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::watch_once
Signaturefunc watch_once(path: String, timeout_ms: Int) -> Int, ErrCode
func watch_once(path: String, timeout_ms: Int) -> Int, ErrCode {
    if __file_watch_once(path, timeout_ms) == 1 {
        return 1, std.OK;
@briefProvides the system library operation `watch_once`.
@detailsExecutes the `watch_once` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
  • timeout_msTimeout in milliseconds; negative values usually select blocking or default timeout behavior.
@returnReturns `Int, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.
functionfs::cancel_all
Signaturefunc cancel_all() -> Int
func cancel_all() -> Int {
    return 0;
}
@briefProvides the system library operation `cancel_all`.
@detailsExecutes the `cancel_all` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionfs::cancel_handle
Signaturefunc cancel_handle(h: Int) -> Int
func cancel_handle(h: Int) -> Int {
    return 0;
}
@briefProvides the system library operation `cancel_handle`.
@detailsExecutes the `cancel_handle` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • hUnderlying runtime handle.
@returnReturns the operation result as `Int`.
functionfs::cancel_future_int
Signaturefunc cancel_future_int(f: Int) -> Int
func cancel_future_int(f: Int) -> Int {
    return 0;
}
@briefProvides the system library operation `cancel_future_int`.
@detailsExecutes the `cancel_future_int` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • fFuture, callback, file handle, or function object that the operation observes or invokes.
@returnReturns the operation result as `Int`.
functionfs::cancel_future_string
Signaturefunc cancel_future_string(f: Int) -> Int
func cancel_future_string(f: Int) -> Int {
    return 0;
}
@briefProvides the system library operation `cancel_future_string`.
@detailsExecutes the `cancel_future_string` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • fFuture, callback, file handle, or function object that the operation observes or invokes.
@returnReturns the operation result as `Int`.
functionfs::cancel_future_bytes
Signaturefunc cancel_future_bytes(f: Int) -> Int
func cancel_future_bytes(f: Int) -> Int {
    return 0;
}
@briefProvides the system library operation `cancel_future_bytes`.
@detailsExecutes the `cancel_future_bytes` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • fFuture, callback, file handle, or function object that the operation observes or invokes.
@returnReturns the operation result as `Int`.
functionfs::queue_len
Signaturefunc queue_len() -> Int
func queue_len() -> Int {
    return __file_queue_len();
}
@briefProvides the system library operation `queue_len`.
@detailsExecutes the `queue_len` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionfs::active_count
Signaturefunc active_count() -> Int
func active_count() -> Int {
    return __file_active_count();
}
@briefProvides the system library operation `active_count`.
@detailsExecutes the `active_count` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionfs::max_queue
Signaturefunc max_queue() -> Int
func max_queue() -> Int {
    return __file_max_queue();
}
@briefProvides the system library operation `max_queue`.
@detailsExecutes the `max_queue` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnReturns the operation result as `Int`.
functionfs::shutdown
Signaturefunc shutdown() -> Void
func shutdown() -> Void {
    _ = __file_shutdown();
}
@briefProvides the system library operation `shutdown`.
@detailsExecutes the `shutdown` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@returnVoid
functionfs::stat
Signaturefunc stat(path: String) -> fs.FileInfo, ErrCode
func stat(path: String) -> fs.FileInfo, ErrCode {
    let out: fs.FileInfo = new fs.FileInfo();
    out.name = file_info_name(path);
@briefProvides the system library operation `stat`.
@detailsExecutes the `stat` system-library API. The documented parameters define the accepted inputs, ownership requirements, range limits, and timeout behavior for this call. Callers must check returned `ErrCode` values or boolean status values before using the result.
@param
  • pathFile or directory path.
@returnReturns `fs.FileInfo, ErrCode`; on success the error code is `std.OK` or `OK`, and on failure the error code describes the failure while any returned value contains the usable partial result when available.

Variables

Class fields (var).

varfs::FileInfo.name
TypeString
@brief`name` field.
@detailsHolds the `name` value for each `FileInfo` instance. The field type is `String`, and constructors and methods keep it synchronized with the object's runtime state.
    var name: String;
    /*
    @brief `size` field.
varfs::FileInfo.size
TypeInt
@brief`size` field.
@detailsStores a size or capacity value. The field type is `Int`, and it is maintained by the constructors and methods of `FileInfo`.
    var size: Int;
    /*
    @brief `is_dir` field.
varfs::FileInfo.is_dir
TypeBool
@brief`is_dir` field.
@detailsHolds the `is_dir` value for each `FileInfo` instance. The field type is `Bool`, and constructors and methods keep it synchronized with the object's runtime state.
    var is_dir: Bool;
    /*
    @brief `ok` field.
varfs::FileInfo.ok
TypeBool
@brief`ok` field.
@detailsIndicates whether the operation or state is valid. The field type is `Bool`, and it is maintained by the constructors and methods of `FileInfo`.
    var ok: Bool;

    /*
varfs::File.path
TypeString
@brief`path` field.
@detailsStores the associated filesystem path. The field type is `String`, and it is maintained by the constructors and methods of `File`.
    var path: String;
    /*
    @brief `h` field.
varfs::File.h
TypeInt
@brief`h` field.
@detailsStores the underlying runtime handle. The field type is `Int`, and it is maintained by the constructors and methods of `File`.
    var h: Int;
    /*
    @brief `offset` field.
varfs::File.offset
TypeInt
@brief`offset` field.
@detailsStores the current read/write offset. The field type is `Int`, and it is maintained by the constructors and methods of `File`.
    var offset: Int;
    /*
    @brief `closed` field.
varfs::File.closed
TypeBool
@brief`closed` field.
@detailsIndicates whether the resource has already been closed. The field type is `Bool`, and it is maintained by the constructors and methods of `File`.
    var closed: Bool;
    /*
    @brief `owns_handle` field.
varfs::File.owns_handle
TypeBool
@brief`owns_handle` field.
@detailsIndicates whether the object owns and must release the underlying handle. The field type is `Bool`, and it is maintained by the constructors and methods of `File`.
    var owns_handle: Bool;

    /*
varfs::Stream.h
TypeInt
@brief`h` field.
@detailsStores the underlying runtime handle. The field type is `Int`, and it is maintained by the constructors and methods of `Stream`.
    var h: Int;
    /*
    @brief `offset` field.
varfs::Stream.offset
TypeInt
@brief`offset` field.
@detailsStores the current read/write offset. The field type is `Int`, and it is maintained by the constructors and methods of `Stream`.
    var offset: Int;
    /*
    @brief `closed` field.
varfs::Stream.chunk_size
TypeInt
@brief`chunk_size` field.
@detailsHolds the `chunk_size` value for each `Stream` instance. The field type is `Int`, and constructors and methods keep it synchronized with the object's runtime state.
    var chunk_size: Int;
    /*
    @brief `closed` field.
varfs::Stream.closed
TypeBool
@brief`closed` field.
@detailsIndicates whether the resource has already been closed. The field type is `Bool`, and it is maintained by the constructors and methods of `Stream`.
    var closed: Bool;
    /*
    @brief `owns_handle` field.
varfs::Stream.owns_handle
TypeBool
@brief`owns_handle` field.
@detailsIndicates whether the object owns and must release the underlying handle. The field type is `Bool`, and it is maintained by the constructors and methods of `Stream`.
    var owns_handle: Bool;

    /*