Skip to main content
Delete a file or directory from the sandbox filesystem.

Basic Usage

from gravixlayer import GravixLayer

client = GravixLayer(api_key="YOUR_API_KEY")

sandbox = client.sandbox.sandboxes.create(template="python-base-v1", timeout=300)
sid = sandbox.sandbox_id

client.sandbox.sandboxes.delete_file(sid, path="/home/user/old_file.txt")

Parameters

ParameterTypeRequiredDescription
sandbox_idstringYesSandbox ID
pathstringYesPath to file or directory to delete

Example: Delete Directory

client.sandbox.sandboxes.delete_file(sid, path="/home/user/temp_folder")

Safety Notes

  • Permanent deletion: Files cannot be recovered after deletion
  • Directory deletion: Deletes directory and all contents recursively
  • Path validation: Ensure correct path to avoid accidental deletion

Next Steps

List Files

View remaining files and directories

Write File

Create new files

Make Directory

Create new directories

Upload File

Upload files to sandbox