Skip to main contentWork with files in HopX sandboxes using comprehensive file operations. This hub covers all filesystem operations, from basic read/write to advanced file watching and bulk transfers.
What You’ll Learn
- How to read and write files in sandboxes
- How to list directories and navigate the filesystem
- How to upload and download files to/from sandboxes
- How to watch files for changes
- How to manage file permissions and metadata
File Operations Overview
| Operation | SDK Method | API Endpoint |
|---|
| Reading | sandbox.files.read() | GET /files/read |
| Writing | sandbox.files.write() | POST /files/write |
| Listing | sandbox.files.list() | GET /files/list |
| Uploading | sandbox.files.upload() | POST /files/upload |
| Downloading | sandbox.files.download() | GET /files/download |
| Watching | sandbox.files.watch() | WebSocket /files/watch |
Core Concepts
Reading Files
Read file contents from sandboxes as text or binary data.
Writing Files
Write text or binary data to files in sandboxes.
Listing Files
List directory contents and navigate the filesystem.
Uploading Files
Upload files from your local machine to sandboxes.
Downloading Files
Download files from sandboxes to your local machine.
Watching Files
Watch files and directories for changes in real-time.
SDK Reference
Python SDK
Complete reference for Python file operations.
- Files Module - Complete filesystem API
files.read() - Read files
files.write() - Write files
files.list() - List directories
files.upload() - Upload files
files.download() - Download files
files.watch() - Watch files
files.exists() - Check existence
files.remove() - Delete files
files.mkdir() - Create directories
JavaScript SDK
Complete reference for JavaScript/TypeScript file operations.
- Files Module - Complete filesystem API
files.read() - Read files
files.write() - Write files
files.list() - List directories
files.upload() - Upload files
files.download() - Download files
files.watch() - Watch files
files.exists() - Check existence
files.remove() - Delete files
files.mkdir() - Create directories
API Reference
VM Agent API
REST API endpoints for file operations.
Quick Start
If you’re new to file operations, start here:
- Reading Files - Read your first file
- Writing Files - Write files to sandboxes
- Listing Files - Navigate directories
Next Steps