rust-lang / rust-lang/rust

Clarify that `fs::copy` dereferences symlinks instead of copying the link itself

Open Beginner friendly
#141,034 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

A-docs A-filesystem C-enhancement T-libs
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

Location

std::fs::copy

Summary

fs::copy, when being called with a symlink as from, does not copy the symlink itself but dereferences it and copies the file behind the symlink. The Rust docs do not really mention this, even if it discoverable that this is the behaviour as the docs mentions not being able to copy symlinks to directories. I think explicitly mentioning this, however, would be a nice addition.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the documentation for std::fs::copy and read the existing description of symlink handling, including the note about symlinks to directories. Clarify that a symlink supplied as the source is dereferenced and its target is copied, then confirm the documentation accurately describes the existing behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
78/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.