Skip to content

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

Open
@ginnyTheCat

Description

@ginnyTheCat

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsT-libsRelevant to the library team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions