{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreiguwohmqmasok4qkorz7myfuucpy4pwiut3inn3hpf3qamovqrbtu",
"uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mh6vul73pqa2"
},
"path": "/t/idea-add-an-option-to-set-the-mode-to-fs-copy/24080#post_10",
"publishedAt": "2026-03-16T04:43:18.000Z",
"site": "https://internals.rust-lang.org",
"textContent": "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.\n\nEDIT: …and `copyfile` now has a `COPYFILE_CLONE` flag, so maybe `fclonefileat` is a distraction anyway.",
"title": "Idea: Add an option to set the mode to fs::copy"
}