Function openat::hardlink

source ·
pub fn hardlink<P, R>(
    old_dir: &Dir,
    old: P,
    new_dir: &Dir,
    new: R
) -> Result<()>
where P: AsPath, R: AsPath,
Expand description

Create a hardlink to a file

Files must be on a single filesystem even if they are in different directories.

Note: by default linkat syscall doesn’t resolve symbolic links, and it’s also behavior of this function. It’s recommended to resolve symlinks manually if needed.