Skip to main content

pick_watch_mount

Function pick_watch_mount 

Source
fn pick_watch_mount<'a>(mounts: &[&'a Path], target: &Path) -> Option<&'a Path>
Expand description

Pick the mount whose path is the longest prefix of target.

Pure, and separated from Disks so it is testable without a real filesystem. Longest-prefix rather than first-match because several mounts legitimately prefix one path (/ and /home both prefix /home/yas/.agentmux) and the most specific one is the filesystem whose free space actually constrains a write there.