Skip to main content

Module FileSystem

Module FileSystem 

Source
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

MethodProviderDescription
FileSystem.ReadFileFileSystemReaderRead raw bytes from a file
FileSystem.WriteFileFileSystemWriterWrite bytes to a file
FileSystem.ReadDirectoryFileSystemReaderList directory entries
FileSystem.StatFileSystemReaderGet file metadata
FileSystem.CreateDirectoryFileSystemWriterCreate a directory (optionally recursive)
FileSystem.DeleteFileSystemWriterDelete a file or directory
FileSystem.RenameFileSystemWriterRename/move a file or directory
FileSystem.CopyFileSystemWriterCopy a file or directory tree

§VS Code reference

vs/platform/files/common/fileService.ts, vs/base/parts/ipc/common/ipc.net.ts

Functions§

CreateEffect
StripFileUriScheme 🔒
Strip a leading file:// (or file:///) scheme from the incoming path. Cocoon sends full URIs like file:///<home>/.land/extensions/... through FileSystem.ReadFile/WriteFile/ReadDirectory; PathBuf from 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:///…”.