AntOS Library — fs (reference)
The
fslibrary's design and native core.fsis where the AntOS filesystem extras live — the stuff standard Lua never had (directory listing, stat, mkdir, tags, catalogue queries) — kept offos/ioso those stay exactly standard. The script-facing API is luau_fs.
What it is
fs covers directory and metadata operations, the DBFS tag/metadata surface, and catalogue queries. All of it is AntOS-specific (no standard equivalent), so it gets its own namespace rather than being bolted onto os/io. File content reading/writing stays in io; fs is metadata, structure, and search.
Design notes
- Auto-cataloguing lives below
fs, in the DBFS/VFS layer — every create/update/delete/rename onD:, from any source (io, C, the network, a command), writes the catalogue row in the same SQLite transaction as the data.fs's tag/meta/query calls are wrappers over those catalogue tables; the dir/stat calls wrap the VFS (antos_library_design §7). - Tags/queries are
D:-only — off DBFS they returnnil, err, so intent-to-tag fails loudly. Tag lifetime: system columns always fresh, user tags sticky across content rewrites, cleared on delete (antos_library_design §12). - For raw SQL and custom application tables,
dbexposes the same DBFS database directly;fs.queryis the safe, shaped catalogue subset over it. - No device surface, ever.
fsdescribes volumes that already exist; it does not create, drive or talk to the hardware behind them. The worked case isfloppy, whose flux calls were considered forfsand deliberately kept out — a library holding both "list a directory" and "read raw magnetic transitions" no longer has a describable purpose. The two meet at exactly one point:floppymounts a decoded disk, andfsthen sees an ordinary catalogued volume. The same reasoning that keepsos/iostandard keepsfsnarrow.
Native core — libantos_fs
libantos_fs sits on the VFS and the DBFS catalogue tables — plain C, no Luau. A file created from C or over the network is catalogued identically, because the catalogue write is in the VFS, not the binding.
Related
- luau_fs — the script API · antos_io (file content) · antos_floppy (device access, kept out of here) · antos_library_design · Filesystem · NFC · AntOS Libraries hub