API Reference › File
namespace

File

Raw file access over the C stdio calls, for programs that read and write their own formats. File.open returns a handle (or null), File.read / File.write move bytes through a bytes buffer, File.seek / File.tell position the cursor, and File.close releases the handle. For text and structured data prefer the higher-level Fs, Json and Prefs APIs.

File.open(path: p, mode: m) -> pointerOpen a file (fopen); null when it cannot be opened.File.read(file: f, buffer: b, count: n) -> intRead up to n bytes into a buffer; returns the bytes read.File.write(file: f, buffer: b, count: n) -> intWrite n bytes from a buffer; returns the bytes written.File.seek(file: f, offset: o, whence: w)Move the file cursor (0 start, 1 current, 2 end).File.tell(file: f) -> intThe cursor position in bytes.File.close(file: f)Close a handle from File.open.
← All symbols