Skip to main content

File System

VoidRun sandboxes come with a complete file system that persists throughout the sandbox lifecycle. Upload files, create directories, and manage data just like a regular Linux environment.

Ephemeral vs. Persistent Storage

Understanding Storage Behavior

Files in a sandbox persist as long as the sandbox exists. When you delete a sandbox, all files are permanently removed.

Storage Characteristics

📁 Ephemeral by Default

Files exist only within the sandbox lifecycle. Delete the sandbox, lose the files.

💾 Large Storage

Each sandbox includes generous disk space for code, dependencies, and data files.

⚡ Fast I/O

Local SSD storage provides fast read/write operations for intensive workloads.

Best Practice: External Persistence

For critical data that needs to survive sandbox deletion:
  1. Download files before terminating sandboxes
  2. Use external storage (S3, GCS, databases) for persistent data
  3. Stream results to external services during execution

Uploading Files

Upload String Content

Write text content directly to a file:

Upload Binary Files

Upload binary data (images, archives, etc.):

Streaming Upload

For large files, use streaming to avoid memory issues:

Downloading Files

Download File Content

Retrieve file contents from the sandbox:

Streaming Download

For large files, use streaming to process data incrementally:

File Operations

List Files

List files in a directory:

Create Files and Directories

Create empty files and directories:

Copy and Move Files

Copy or move files within the sandbox:

Delete Files

Remove files and directories:

Get File Information

Retrieve file metadata and statistics:

Search Files

Find files matching a pattern:

Archive Operations

Compress Files

Create archives of files and directories:

Extract Archives

Extract compressed archives:

File Watching

Monitor file changes in real-time:

Complete Example: Data Processing Pipeline

Here’s a complete example showing file operations in a data processing workflow:

Next Steps

Custom Images

Create custom Docker images with pre-configured environments.

Package Management

Install and manage packages dynamically in sandboxes.