AntOS Library — io (reference)

The io library's design and native core. io is standard Lua file I/O — normal handles, normal nil, 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, err shaping live in libantos_bind, so they match reference Lua exactly; the opts argument 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 seek works on multi-gigabyte objects.
  • On a D: write the opts path calls into libantos_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 are fs'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

Important: The Ant64 family of home computers are at early design/prototype stage, everything you see here is subject to change.