Skip to content

Commit d0178b4

Browse files
committed
Make it platform-specific whether hard_link follows symlinks.
Also mention that where possible, `hard_link` does not follow symlinks.
1 parent ce00b3e commit d0178b4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

library/std/src/fs.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -1701,8 +1701,9 @@ pub fn copy<P: AsRef<Path>, Q: AsRef<Path>>(from: P, to: Q) -> io::Result<u64> {
17011701
/// The `dst` path will be a link pointing to the `src` path. Note that systems
17021702
/// often require these two paths to both be located on the same filesystem.
17031703
///
1704-
/// If `src` names a symbolic link, it is not followed. The created hard link
1705-
/// points to the symbolic link itself.
1704+
/// If `src` names a symbolic link, it is platform-specific whether the symbolic
1705+
/// link is followed. On platforms where it's possible to not follow it, it is
1706+
/// not followed, and the created hard link points to the symbolic link itself.
17061707
///
17071708
/// # Platform-specific behavior
17081709
///

0 commit comments

Comments
 (0)