Skip to main content

Module FileSystem

Module FileSystem 

Source
Expand description

File-system-domain handlers for CocoonService. Eleven entry points covering read/write/stat, directory ops, watch, glob/text search, and delete/rename/copy/create-directory.

Modulesยง

CopyFile
Copy a file, creating any missing target parents first.
CreateDirectory
Create a directory (and any missing parents).
DeleteFile
Remove a file or recursively remove a directory.
FindFiles
Walk every workspace root collecting paths that match pattern (globset). Falls back to cwd when no roots are open.
FindTextInFiles
Substring search across the workspace, capped at 1,000 matches. Skips hidden directories plus node_modules and target. Runs the walk in tokio::task::spawn_blocking so the event loop stays responsive.
ReadFile
Read a file from disk and return its bytes (always tagged utf-8 - the encoding negotiation lives in Cocoon).
Readdir
Enumerate the entries of a directory by name.
RenameFile
Rename a file or directory, creating any missing target parents first.
Stat
Inspect a path: type, size, mtime in ms-since-epoch.
WatchFile
Register a file watcher. TODO(P1): wire notify and store the handle in ApplicationState.Feature.Watchers so cancel_operation can stop it.
WriteFile
Write bytes to disk, creating any missing parent directories.