sandbox.files to move data in and out of a sandbox. The SDK handles data-plane routing and authentication transparently.
Using
AsyncSandbox? The same files methods are there, awaitable.Write binary content
write() accepts strings or raw bytes. Parent directories are created automatically.
Read as bytes or text
read()returns raw bytes (Uint8Arrayin TypeScript,bytesin Python)readText()/read_text()returns a UTF-8-decoded string
Path rules
Paths passed tofiles.* methods must:
- Start with
/- only absolute paths are accepted - Contain no
..segments - no traversal
mkdir -p first.