os.file{
dirname:str,
filename:str,
path:str,
ext:str,
size:int,
is_dir:bool,
mod_time:time,
err:str
}
Returns metadata about the files in the dirname provided.
Check err for any failures.
Examples
files in cwd
import("os")
os.file(os.cwd)
┌──────────────┬──────────────────────────────────┬─────┬──────┬────────┬─────────────────────────────────────┬─────┐ │ filename │ path │ ext │ size │ is_dir │ mod_time │ err │ ├──────────────┼──────────────────────────────────┼─────┼──────┼────────┼─────────────────────────────────────┼─────┤ │ _schema_lock │ /home/ra/schema_one/_schema_lock │ │ 13 │ false │ 2026-08-05T23:26:33.977522873+01:00 │ │ │ init.ra │ /home/ra/schema_one/init.ra │ .ra │ 36 │ false │ 2025-07-02T22:57:41.012998643+01:00 │ │ └──────────────┴──────────────────────────────────┴─────┴──────┴────────┴─────────────────────────────────────┴─────┘
invalid dirname
import("os")
os.file(dirname:="bad")
┌──────────┬──────┬─────┬──────┬────────┬──────────────────────┬─────────────────────────────────────────────────────────┐ │ filename │ path │ ext │ size │ is_dir │ mod_time │ err │ ├──────────┼──────┼─────┼──────┼────────┼──────────────────────┼─────────────────────────────────────────────────────────┤ │ │ │ │ 0 │ false │ 0001-01-01T00:00:00Z │ Failed reading dir: open bad: no such file or directory │ └──────────┴──────┴─────┴──────┴────────┴──────────────────────┴─────────────────────────────────────────────────────────┘