LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Agent
  • Middleware
  • Backends
  • Sandboxes
  • Skills
  • Subagents
  • Types
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
  • Vitest
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewAgentMiddlewareBackendsSandboxesSkillsSubagentsTypes
Modal
Daytona
Deno
Node VFS
Sandbox Standard Tests
Vitest
Language
Theme
JavaScriptdeepagentsindexBaseSandboxdelete
Method●Since v1.11

delete

Delete a file or directory from the sandbox via a server-side rm.

Runs test -e || test -L first: a path that does not exist (and is not a broken symlink) returns a not-found error, matching the contract of FilesystemBackend and StateBackend. Because a shell test has no error channel, a non-zero probe conflates "absent" with "unstattable" (e.g. an unsearchable parent directory); an unknown exit code is not treated as absent and falls through to the delete.

Uses rm -rf, so directories are removed recursively along with their contents. A non-zero rm exit (e.g. a permission error) is reported as a failure.

Copy
delete(filePath: string): Promise<DeleteResult>

Parameters

NameTypeDescription
filePath*string
View source on GitHub