xx
.md

io_stat

io_stat synchronously waits for dependencies, then returns information about a project-relative path. It follows symbolic links that remain inside the project root; links that escape the project root return an error. A missing path returns None instead of an error.

Existing paths return a struct with these fields:

FieldTypeDescription
namestringBase name of the path.
sizeintFile size in bytes.
modeintGo file mode and permission bits.
mod_timeintModification time as Unix seconds.
is_dirboolWhether the path is a directory.

Arguments

ArgumentRequiredDescription
pathYesProject-relative path to inspect.
depsNoDependencies to complete before inspecting the path.

Example

load("@io@1", "io_stat")

info = io_stat("generated/output.txt")
if info != None:
    print(info.size)