External Publication
Visit Post

Idea: Add an option to set the mode to fs::copy

Rust Internals [Unofficial] March 16, 2026
Source

The Mac fclonefileat operates on a directory descriptor + basename for the destination, not a file descriptor. Which makes sense, since it is modifying directory entries rather than file contents. That said, I'm also not sure it can modify permissions atomically with the clone—the manpage suggests you can choose "same as original, if permitted" or "reset to the default for the destination directory". Which means changing the fs API wouldn't be able to provide atomicity anyway.

EDIT: …and copyfile now has a COPYFILE_CLONE flag, so maybe fclonefileat is a distraction anyway.

Discussion in the ATmosphere

Loading comments...