Documentation Index Fetch the complete documentation index at: https://e2b.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
You can get information about a file or directory using the files.getInfo() / files.get_info() methods. Information such as file name, type, and path is returned.
JavaScript & TypeScript
Python
import { Sandbox } from 'e2b'
const sandbox = await Sandbox. create ()
// Create a new file
await sandbox.files. write ( 'test_file.txt' , 'Hello, world!' )
// Get information about the file
const info = await sandbox.files. getInfo ( 'test_file.txt' )
console. log (info)
// {
// name: 'test_file.txt',
// type: 'file',
// path: '/home/user/test_file.txt',
// size: 13,
// mode: 0o644,
// permissions: '-rw-r--r--',
// owner: 'user',
// group: 'user',
// modifiedTime: '2025-05-26T12:00:00.000Z',
// symlinkTarget: null
// }
JavaScript & TypeScript
Python
import { Sandbox } from 'e2b'
const sandbox = await Sandbox. create ()
// Create a new directory
await sandbox.files. makeDir ( 'test_dir' )
// Get information about the directory
const info = await sandbox.files. getInfo ( 'test_dir' )
console. log (info)
// {
// name: 'test_dir',
// type: 'dir',
// path: '/home/user/test_dir',
// size: 0,
// mode: 0o755,
// permissions: 'drwxr-xr-x',
// owner: 'user',
// group: 'user',
// modifiedTime: '2025-05-26T12:00:00.000Z',
// symlinkTarget: null
// }