**Changelog**
- Adds `files.getInfo`, `files.get_info` methods to the SDKs.
- Adds tests for the new methods
- Adds documentation for the above.
**Examples**
JavaScript
```js
import { Sandbox } from '@e2b/code-interpreter'
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'
// }
```
Python
```py
from e2b_code_interpreter import Sandbox
sandbox = Sandbox()
# Create a new file
sandbox.files.write('test_file', 'Hello, world!')
# Get information about the file
info = sandbox.files.get_info('test_file')
print(info)
# EntryInfo(name='test_file.txt', type=<FileType.FILE: 'file'>, path='/home/user/test_file.txt')
```
---------
Co-authored-by: Jakub Novak <jakub@e2b.dev>
16 lines
421 B
YAML
16 lines
421 B
YAML
# buf.gen.yaml defines a local generation template.
|
|
# For details, see https://buf.build/docs/configuration/v1/buf-gen-yaml
|
|
version: v1
|
|
plugins:
|
|
- plugin: python
|
|
out: ../../packages/python-sdk/e2b/envd
|
|
opt:
|
|
- pyi_out=../../packages/python-sdk/e2b/envd
|
|
- name: connect-python
|
|
out: ../../packages/python-sdk/e2b/envd
|
|
path: protoc-gen-connect-python
|
|
|
|
managed:
|
|
enabled: true
|
|
optimize_for: SPEED
|