Files
The panel’s calls for a box’s own files. Each one runs as the box user, through the same command path as the terminal. A device box has none.
| Call | What it does |
|---|---|
files.tree |
The home or a folder and its first level in one command. A name index runs after the tree is drawn. Cached folders reopen before refresh. |
files.home |
The box user’s home directory, as an absolute path. |
files.list |
The names in one directory, in one command. At most 5,000. A name with a newline is left out. |
files.read |
A file and its SHA-256. Text up to 4 MB, an image up to 2 MB. Past that, the size and the hash, and no bytes. |
files.readRange |
A slice of a file, at most 256 KB, with the whole file’s size and SHA-256. |
files.write |
Replaces a file. With expectedSha256, writes only when the file still has that hash. Without it, overwrites. |
files.create |
Creates a file or a directory. Refuses when the name is taken. |
files.rename |
Renames a file or a directory. Refuses when the new name is taken. |
files.delete |
Deletes a file or a directory. Refuses the root of the filesystem and the box user’s home. |
files.search |
Finds lines under a directory. ripgrep when the box has it, otherwise grep. At most 2,000 hits or 500 files. |
files.names |
File paths under a directory, for go to file. Skips .git, node_modules and vendor. At most 20,000. |