AntOS Library — io (reference)
The
iolibrary's design and native core.iois standard Lua file I/O — normal handles, normalnil, err— over drive-letter paths, with an optional DBFS tags extension. The script-facing API is luau_io.
What it is
io.open(path, mode) returns a normal Lua file handle (:read/:write/:seek/:lines/:close) with reference semantics. The only AntOS-visible differences: path is a drive-letter string, and an optional trailing opts table can attach DBFS tags/meta on D:.
Design notes
- Standard by construction — the read-format parser and
nil, errshaping live inlibantos_bind, so they match reference Lua exactly; theoptsargument is always last and optional, so the two-argument call is untouched (antos_library_design §6). - The handle is backed by the VFS stream interface: FATFS for plain volumes, SQLite incremental BLOB for DBFS — so files are bounded by disk, not RAM, and
seekworks on multi-gigabyte objects. - On a
D:write theoptspath calls intolibantos_fs/DBFS to attach catalogue rows in the file's write transaction; structural cataloguing (path/size/mtime/checksum) happens regardless (antos_library_design §7). - File content is
io's job; directory listing, stat, tags, and queries arefs's.
Native core — libantos_io
libantos_io owns the handle type over the VFS stream interface — no Luau dependency, so the same core serves any linker. The tags path bridges to libantos_fs.
Related
- luau_io — the script API · antos_fs (directories, tags, queries) · antos_library_design · Filesystem · AntOS Libraries hub