> ## Documentation Index
> Fetch the complete documentation index at: https://e2b.manicule.dev/llms.txt
> Use this file to discover all available pages before exploring further.
> For every page in one file, fetch https://e2b.manicule.dev/llms-full.txt (large).
> To search and read these docs as tools, connect the MCP server at https://e2b.manicule.dev/api/mcp.
> Every agent surface: https://e2b.manicule.dev/.well-known/llms-manifest.json

# Get information about a file or directory (/docs/volumes/info)

<!-- agent-signals: reading_time_min: 3 · est_tokens: 1019 · updated: 2026-07-30 -->
Related: [Download data from volume](/docs/volumes/download.md), [Managing volumes](/docs/volumes/manage.md), [Migrating data between volumes](/docs/volumes/migrate.md), [Mounting volumes](/docs/volumes/mount.md), [Read & write files](/docs/volumes/read-write.md), [Upload data to volume](/docs/volumes/upload.md)

> Get metadata, check existence, and update permissions for files and directories in a volume.

You can get information about a file or directory in a volume using the `getInfo()` / `get_info()` method.

### Getting information about a file

<CodeGroup>
```js title="JavaScript & TypeScript"
import { Volume } from 'e2b'

const volume = await Volume.create('my-volume')

// Create a new file
await volume.writeFile('/test_file.txt', 'Hello, world!')

// Get information about the file
const info = await volume.getInfo('/test_file.txt')

console.log(info)
// {
//   name: 'test_file.txt',
//   type: 'file',
//   path: '/test_file.txt',
//   size: 13,
//   mode: 0o644,
//   uid: 0,
//   gid: 0,
//   atime: 2025-05-26T12:00:00.000Z,
//   mtime: 2025-05-26T12:00:00.000Z,
//   ctime: 2025-05-26T12:00:00.000Z,
// }
```

```python title="Python"
from e2b import Volume

volume = Volume.create('my-volume')

# Create a new file
volume.write_file('/test_file.txt', 'Hello, world!')

# Get information about the file
info = volume.get_info('/test_file.txt')

print(info)
# VolumeEntryStat(
#   name='test_file.txt',
#   type_='file',
#   path='/test_file.txt',
#   size=13,
#   mode=0o644,
#   uid=0,
#   gid=0,
#   atime=datetime(2025, 5, 26, 12, 0, 0),
#   mtime=datetime(2025, 5, 26, 12, 0, 0),
#   ctime=datetime(2025, 5, 26, 12, 0, 0),
# )
```
</CodeGroup>

### Getting information about a directory

<CodeGroup>
```js title="JavaScript & TypeScript"
import { Volume } from 'e2b'

const volume = await Volume.create('my-volume')

// Create a new directory
await volume.makeDir('/test_dir')

// Get information about the directory
const info = await volume.getInfo('/test_dir')

console.log(info)
// {
//   name: 'test_dir',
//   type: 'directory',
//   path: '/test_dir',
//   size: 0,
//   mode: 0o755,
//   uid: 0,
//   gid: 0,
//   atime: 2025-05-26T12:00:00.000Z,
//   mtime: 2025-05-26T12:00:00.000Z,
//   ctime: 2025-05-26T12:00:00.000Z,
// }
```

```python title="Python"
from e2b import Volume

volume = Volume.create('my-volume')

# Create a new directory
volume.make_dir('/test_dir')

# Get information about the directory
info = volume.get_info('/test_dir')

print(info)
# VolumeEntryStat(
#   name='test_dir',
#   type_='directory',
#   path='/test_dir',
#   size=0,
#   mode=0o755,
#   uid=0,
#   gid=0,
#   atime=datetime(2025, 5, 26, 12, 0, 0),
#   mtime=datetime(2025, 5, 26, 12, 0, 0),
#   ctime=datetime(2025, 5, 26, 12, 0, 0),
# )
```
</CodeGroup>

### Checking if a path exists

You can check whether a file or directory exists in a volume using the `exists()` method.

<CodeGroup>
```js title="JavaScript & TypeScript"
import { Volume } from 'e2b'

const volume = await Volume.create('my-volume')

const fileExists = await volume.exists('/test_file.txt')
console.log(fileExists) // true or false
```

```python title="Python"
from e2b import Volume

volume = Volume.create('my-volume')

file_exists = volume.exists('/test_file.txt')
print(file_exists)  # True or False
```
</CodeGroup>

### Updating metadata

You can update file or directory metadata such as user ID, group ID, and permissions mode using the `updateMetadata()` / `update_metadata()` method.

<CodeGroup>
```js title="JavaScript & TypeScript"
import { Volume } from 'e2b'

const volume = await Volume.create('my-volume')

await volume.writeFile('/test_file.txt', 'Hello, world!')

const updated = await volume.updateMetadata('/test_file.txt', { uid: 1000, gid: 1000, mode: 0o600 })

console.log(updated)
// {
//   name: 'test_file.txt',
//   type: 'file',
//   path: '/test_file.txt',
//   size: 13,
//   mode: 0o600,
//   uid: 1000,
//   gid: 1000,
//   ...
// }
```

```python title="Python"
from e2b import Volume

volume = Volume.create('my-volume')

volume.write_file('/test_file.txt', 'Hello, world!')

updated = volume.update_metadata('/test_file.txt', uid=1000, gid=1000, mode=0o600)

print(updated)
# VolumeEntryStat(
#   name='test_file.txt',
#   type_='file',
#   path='/test_file.txt',
#   size=13,
#   mode=0o600,
#   uid=1000,
#   gid=1000,
#   ...
# )
```
</CodeGroup>
