metadata option.
The metadata is persisted with the file and returned by files.getInfo() / files.get_info(), files.list(), and files.rename().
Prerequisites
Custom file metadata requires templates with envd versionv0.6.2 or above. If you are using a custom template created before envd v0.6.2, you need to rebuild it.
You can check the template envd version using the e2b template list command or by viewing the templates list on the dashboard.
Writing a file with metadata
Writing multiple files with metadata
When writing multiple files, the same metadata is applied to every file in the upload.Reading metadata back
Limitations
- Metadata keys and values must be printable US-ASCII characters.
- Keys are lowercased by the sandbox, so they may differ in case when read back.
- Overwriting a file replaces its metadata — metadata from the previous write is not preserved.
- Metadata is stored as
user.e2b.*extended attributes on the file inside the sandbox, so you can also read or set it from within the sandbox using standard tools likegetfattrandsetfattr.