Skip to content

Commit

Permalink
Make it platform-specific whether hard_link follows symlinks.
Browse files Browse the repository at this point in the history
Also mention that where possible, `hard_link` does not follow symlinks.
  • Loading branch information
sunfishcode committed Oct 21, 2020
1 parent ce00b3e commit d0178b4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions library/std/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1701,8 +1701,9 @@ pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<u64> {
/// The `dst` path will be a link pointing to the `src` path. Note that systems
/// often require these two paths to both be located on the same filesystem.
///
/// If `src` names a symbolic link, it is not followed. The created hard link
/// points to the symbolic link itself.
/// If `src` names a symbolic link, it is platform-specific whether the symbolic
/// link is followed. On platforms where it's possible to not follow it, it is
/// not followed, and the created hard link points to the symbolic link itself.
///
/// # Platform-specific behavior
///
Expand Down

0 comments on commit d0178b4

Please sign in to comment.