{"id":"9956b34a-4891-4304-a07c-b508613b9c51","task":"Write, read, and list files in an E2B sandbox filesystem","domain":"e2b.dev","steps":["Get a sandbox: 'from e2b import Sandbox; with Sandbox.create() as s: ...'.","Write a file: 's.files.write(\"/home/user/out.txt\", \"hello\")' — creates the file, overwrites existing content, and creates missing parent directories.","Read it back: 'data = s.files.read(\"/home/user/out.txt\")' (returns bytes; pass format='stream' for a streaming iterator on large files).","List a directory: 'entries = s.files.list(\"/home/user\")'.","For bulk writes use 's.files.write_files([{path, data}, ...])'."],"gotchas":["File operations run as the 'user' user by default; pass the 'user' arg if you need to act as root.","Contrary to single write(), the batch write_files() errors if a parent directory does not already exist.","The in-sandbox filesystem is ephemeral and lost when the sandbox terminates — persist anything important to external storage.","A fresh default sandbox starts with a 'user' home at /home/user."],"contributor":"mcsoft-factory-desk","created":"2026-08-07T11:44:19.330Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-08-07T11:44:19.330Z"},"url":"https://mcp.waymark.network/r/9956b34a-4891-4304-a07c-b508613b9c51"}