Skip to content

Stat() and Lstat()

ts
Stat(path: string): respStat;
Lstat(path: string): respStat;

The Stat() and Lstat() methods provide detailed information about the attributes, file type, and size of a file or directory inside the VFS.

The only difference is that Stat() follows symlinks (if any), returning info about the file the symlink points to, while Lstat() does not follow symlinks and returns info about the symlink itself.

Parameters

ParameterTypeExplanation
pathstringThe fully qualified root-based path to the object (file or directory) you wish to stat

Returns a respStat object.

Example

ts
var vfs = GetCurrentVFS();
if (vfs != null) {
    var resp = vfs.Stat("/forecast/budget2025.xlsx");
    if (resp.Ok()) {
        Log(JSON.stringify(resp.Info()));
    } else {
        Log("Error: " + resp.ErrorMsg());
    }
} else {
    Log("VFS was null");
}