Expand description
§FileSystem Effect (CreateEffectForRequest)
Effect constructors for the FileSystem.* RPC family. Each handler
delegates to the FileSystemReader or FileSystemWriter provider trait on
MountainEnvironment. All methods accept file:// URIs from Cocoon and
strip the scheme before passing a native PathBuf to the provider.
§Methods handled
| Method | Provider | Description |
|---|---|---|
FileSystem.ReadFile | FileSystemReader | Read raw bytes from a file |
FileSystem.WriteFile | FileSystemWriter | Write bytes to a file |
FileSystem.ReadDirectory | FileSystemReader | List directory entries |
FileSystem.Stat | FileSystemReader | Get file metadata |
FileSystem.CreateDirectory | FileSystemWriter | Create a directory (optionally recursive) |
FileSystem.Delete | FileSystemWriter | Delete a file or directory |
FileSystem.Rename | FileSystemWriter | Rename/move a file or directory |
FileSystem.Copy | FileSystemWriter | Copy a file or directory tree |
§VS Code reference
vs/platform/files/common/fileService.ts,
vs/base/parts/ipc/common/ipc.net.ts
Functions§
- Create
Effect - Strip
File 🔒UriScheme - Strip a leading
file://(orfile:///) scheme from the incoming path. Cocoon sends full URIs likefile:///<home>/.land/extensions/...throughFileSystem.ReadFile/WriteFile/ReadDirectory;PathBuffrom such a string treats the scheme literally and every read 404s. Without this the redhat.java activation (and any other extension that uses the gRPC fs.readFile path for its own package.json) fails with “Resource not found: file:///…”.