Skip to main content
Use sb.fs on a running sandbox. Sandbox-local files disappear when the sandbox ends unless you capture a filesystem image or write to mounted persistent storage.

Read and write without local temporary files

write_text accepts encoding (default UTF-8) and mode; write_bytes accepts mode. Both default to file permissions 0o644.

Transfer local files

Create destination directories with sb.fs.create_directory("/workspace/results") when your workflow needs them. Use volumes or cloud buckets for shared datasets; see storage configuration.

Inspect and wait

wait_for checks for the file; it does not wait for a process to exit. When possible, wait for the producing process first so you know the write completed.

Search, replace, and remove

find_in_files searches file contents using the supplied pattern; it is not a filename glob search. Methods raise SandboxFileSystemError when a filesystem operation fails.

Async operations

The same operations are available through sb.aio.fs: