{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiel76jrgxqij3uwivqbxcqjg5jv4ueg4mxx5z7sbsvkigxayyg7vy",
    "uri": "at://did:plc:ivbknywyskln22er3nkssdhl/app.bsky.feed.post/3mh2ivfg2fnu2"
  },
  "path": "/t/idea-add-an-option-to-set-the-mode-to-fs-copy/24080#post_6",
  "publishedAt": "2026-03-14T19:32:00.000Z",
  "site": "https://internals.rust-lang.org",
  "tags": [
    "`NtCopyFileChunk`",
    "**CopyFile**"
  ],
  "textContent": "On Windows you're correct, there's no single function to copy using file handles. You can implement this manually (which is essentially what `CopyFile` does) but that's more involved. There are some low-level functions which can help, such as `NtCopyFileChunk`, but that doesn't copy metadata itself and it doesn't work in all cases. Quoting from those docs:\n\n> `NtCopyFileChunk` is used internally by **CopyFile** for most forms of copy. Current exceptions include cloud copies, SMB offload and ODX.",
  "title": "Idea: Add an option to set the mode to fs::copy"
}