Function restricts_names

Source
pub fn restricts_names(destination: &Path) -> bool
Expand description

Asks the destination itself what it accepts, by trying.

Deliberately empirical. The alternative is to read the filesystem’s name and infer from it, which needs platform-specific code and is wrong exactly where it matters: a FUSE mount, an SMB share of a Windows folder, or a card reader all report something the table does not list, and the inference has to guess. Creating one file settles the question for the volume actually being written to.

A failure to probe reads as “restricted”: a copy that adapts names it did not have to costs a few odd characters, one that fails to adapt names it should have costs the run.