Function link
pub fn link<P, Q>(old_path: P, new_path: Q) -> Result<(), Errno> ⓘ
Available on crate feature
dep_rustix
only.Expand description
link(old_path, new_path)
—Creates a hard link.
POSIX leaves it implementation-defined whether link
follows a symlink in
old_path
, or creates a new link to the symbolic link itself. On platforms
which have it, linkat
avoids this problem since it has an AtFlags
parameter and the AtFlags::SYMLINK_FOLLOW
flag determines whether
symlinks should be followed.