Skip to main content
Use metadata commands when you need to understand the contents of a persistent volume without launching a sandbox.

List Directories

entries = volume.files.list("/datasets")
for item in entries:
    print(item.path, item.type, item.size)
Direct volume paths are rooted at / and do not use sandbox cwd.

Inspect A Path

info = volume.files.info("/datasets/report.txt")
print(info.path, info.type, info.size, info.modified_at)

same = volume.files.get_info("/datasets/report.txt")
info and stat both return metadata JSON. get_info() is an SDK alias for info().

Check Existence

if volume.files.exists("/datasets/report.txt"):
    print("present")
The CLI exits with status 0 when the path exists and 1 when it does not.

Create Directories

volume.files.make_dir("/datasets")

Search Names And Contents

content_matches = volume.files.find_files("/datasets", "needle")
name_matches = volume.files.search_files("/datasets", "*.json")
find searches file contents. search matches file names.

Watch Changes

def on_event(event):
    print(event.type, event.path)

with volume.files.watch_dir("/datasets", on_event=on_event, recursive=True):
    ...
Watches stream JSON events. In multi-host deployments, clients should treat resync_required as a signal to list or stat the watched tree again.