nix::fcntl

Function renameat

source
pub fn renameat<P1: ?Sized + NixPath, P2: ?Sized + NixPath>(
    old_dirfd: Option<RawFd>,
    old_path: &P1,
    new_dirfd: Option<RawFd>,
    new_path: &P2,
) -> Result<()>
Expand description

Change the name of a file.

The renameat function is equivalent to rename except in the case where either old_path or new_path specifies a relative path. In such cases, the file to be renamed (or the its new name, respectively) is located relative to old_dirfd or new_dirfd, respectively

ยงSee Also

renameat