--- title: Files full: true _openapi: preload: - ./specs/toolbox-api.json toc: - depth: 2 title: List files url: '#list-files' - depth: 2 title: Delete a file or directory url: '#delete-a-file-or-directory' - depth: 2 title: Download many files url: '#download-many-files' - depth: 2 title: Upload many files url: '#upload-many-files' - depth: 2 title: Download one file url: '#download-one-file' - depth: 2 title: Find text in files url: '#find-text-in-files' - depth: 2 title: Create a folder url: '#create-a-folder' - depth: 2 title: Get file metadata url: '#get-file-metadata' - depth: 2 title: Move a file or directory url: '#move-a-file-or-directory' - depth: 2 title: Change permissions url: '#change-permissions' - depth: 2 title: Replace text in files url: '#replace-text-in-files' - depth: 2 title: Search filenames url: '#search-filenames' - depth: 2 title: Upload one file url: '#upload-one-file' - depth: 2 title: Watch a directory url: '#watch-a-directory' structuredData: headings: - content: List files id: list-files - content: Delete a file or directory id: delete-a-file-or-directory - content: Download many files id: download-many-files - content: Upload many files id: upload-many-files - content: Download one file id: download-one-file - content: Find text in files id: find-text-in-files - content: Create a folder id: create-a-folder - content: Get file metadata id: get-file-metadata - content: Move a file or directory id: move-a-file-or-directory - content: Change permissions id: change-permissions - content: Replace text in files id: replace-text-in-files - content: Search filenames id: search-filenames - content: Upload one file id: upload-one-file - content: Watch a directory id: watch-a-directory contents: - content: List entries under the requested directory. Omitting `path` uses the daemon work directory. `depth` defaults to `1` and recursive listings are capped at 10,000 entries. heading: list-files - content: Delete one file. Directories require `recursive=true` or `recursive=1`. heading: delete-a-file-or-directory - content: Stream a multipart response with `file` parts for successful paths and `error` parts carrying error envelopes for per-path failures. The outer response stays 200 on partial success. heading: download-many-files - content: "Stream multipart uploads correlated by `files[i].path` and `files[i].file`. Partial success is reported in the JSON body: each destination is created and opened under the same rules as `/files/upload` (paths normalized lexically, created files and directories handed to the sandbox default OS user, and — when one is configured — every write and every directory creation opened as that user could have; a per-entry refusal appears in `errors` and creates nothing). When `atomic=true`, each successful file is written through a temporary file + rename with no non-atomic fallback, and an unsupported atomic rename is reported in that entry's `errors` slot while the rest of the batch continues." heading: upload-many-files - content: Stream one file as `application/octet-stream`. Directories are rejected. heading: download-one-file - content: Walk the tree rooted at `path` and return literal substring matches with one-based line numbers. heading: find-text-in-files - content: Create the requested directory tree. Omitting `mode` uses the route default. heading: create-a-folder - content: Return one `FileInfo` record for the requested path. heading: get-file-metadata - content: Rename the path when possible, or copy-then-remove across filesystems. heading: move-a-file-or-directory - content: Change mode and, on platforms that support it, owner and group. heading: change-permissions - content: Replace a literal substring across the requested files. File-specific failures stay inside the 200 response body. heading: replace-text-in-files - content: Walk the tree rooted at `path` and return absolute file paths whose base name matches the glob `pattern`. heading: search-filenames - content: 'Stream the multipart part named `file` to the destination path from the query string. The path is normalized lexically (`..` collapsed) before use. A newly created file — and every parent directory this call created — is owned by the sandbox default OS user when one is configured; a pre-existing file is rewritten in place and never re-owned. A symlink at the path is followed one hop, opened without following further links, and never re-owned. When `atomic=true`, the daemon writes a temporary file in the destination directory, fsyncs it, applies the destination mode, and renames it over the target with no non-atomic fallback. When a default OS user is configured every write — and every directory this call would create — is opened as that user could have: search permission on every directory, write permission on the destination (or on the deepest existing directory when parents are missing), symlinks anywhere on the path followed under the same rules; otherwise 403 `FILE_ACCESS_DENIED` and nothing is created.' heading: upload-one-file - content: Server-sent events for one directory. The stream emits `start` with `{}`, `fs` with `WatchFsEvent`, and `overflow` with `WatchOverflowEvent`. `follow=true` is accepted and ignored for compatibility. heading: watch-a-directory methods: - GET - DELETE - POST - POST - GET - GET - POST - GET - POST - POST - POST - GET - POST - GET --- {/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */} export default function Layout(props) { const { OpenAPIPage } = props.components ?? {}; return ( <> {props.children} ); }