Skip to content

file_stat

Gate: ungated · belongs to file · read

Ask about a path without reading it. Ungated, like the other file reads — see the file kind.

Input

FieldTypeRequiredNotes
pathstringyesWorkspace-relative path.

Output

A JSON object; a missing path answers rather than erroring:

{ "exists": true, "isDir": false, "size": 214 }

A path that is not there returns {"exists": false} — absence is an answer, not a failure.

From JavaScript

const s = await nocturn.fs.stat("notes/todo.md");
if (s.exists && !s.isDir) console.log(s.size);