Skip to main content

Module fs_executor

Module fs_executor 

Source
Expand description

Wet-run executor — slice 5b.

FsExecutor is the concrete counterpart to super::plan::PlanExecutor: same trait surface, real side effects. The execute method stays a thin dispatcher (one arm per action variant) so cyclomatic complexity lives in the per-action helpers rather than the vtable entry point.

§Platform gating

  • Symlink creation uses std::os::unix::fs::symlink on Unix and std::os::windows::fs::{symlink_file, symlink_dir} on Windows.
  • Persistent env writes use winreg on Windows; Unix returns ExecError::EnvPersistenceNotSupported for user / machine scopes (shell-rc editing is out of scope for this slice).
  • Mode bits are applied on Unix only; Windows ignores them.

§Error propagation

Every filesystem op routes through a small internal io_to_fs helper so the resulting ExecError::FsIo carries the op tag and the offending path. Blanket From<std::io::Error> is deliberately avoided so unrelated call sites cannot silently leak a context-free io error.

Structs§

FsExecutor
Wet-run ActionExecutor — performs real filesystem and process work.