Skip to main content

Module files

Module files 

Source
Expand description

File identity for #[psync::graph(owned_files)]: two paths name one file when the operating system says so, not when their text matches.

A path is resolved once, when its region (or its loop) starts:

  • an existing file is identified by its device and inode (Unix), which hard links share;
  • every path also gets its resolved form: std::fs::canonicalize (symlinks followed) when it exists, else its parent’s canonical form joined with its name (a file about to be created), else std::path::absolute (Rust 1.79; lexical, as a last resort).

Two identities overlap when their inodes match, or when one resolved path contains the other.

Structs§

FileId
What a path names, as far as the file system can tell when it is resolved.

Functions§

canonical_parent 🔒
For a file not created yet: its directory resolved, then its name.
files_overlap
The gate’s test under owned_files: whether a and b may be one file.
inode 🔒
Device and inode of an existing file.
resolve 🔒
The canonical path, or the canonical parent joined with the name, or the absolute path.
within 🔒
Whether one path is the other or under it.