Skip to main content

Module ReadOperations

Module ReadOperations 

Source
Expand description

§FileSystemProvider - Read Operations

Implements FileSystemReader for MountainEnvironment. All three functions call Utility::PathSecurity::IsPathAllowedForAccess first, which enforces workspace-trust rules and prevents path-traversal escapes.

§Functions

  • read_file_impl - validates the path is a regular file (not a directory), then reads bytes via tokio::fs::read.
  • stat_file_impl - returns a FileSystemStatDTO with file type flags (File / Directory / SymbolicLink bitmask), mtime, ctime, and size. Symlink detection uses a second symlink_metadata call because metadata follows links. Permissions is currently None; see the inline comment for the Windows / Unix implementation plan. CreationTime falls back to 0 on platforms that don’t expose it (e.g. Linux).
  • read_directory_impl - validates the path is a directory, streams entries via tokio::fs::read_dir, and classifies each entry as File, Directory, SymbolicLink, or Unknown.

Functions§

read_directory_impl 🔒
ReadDirectory operations implementation for MountainEnvironment
read_file_impl 🔒
Read operations implementation for MountainEnvironment
stat_file_impl 🔒
Stat operations implementation for MountainEnvironment