Function nix::unistd::fchownat[][src]

pub fn fchownat<P: ?Sized + NixPath>(
    dirfd: Option<RawFd>,
    path: &P,
    owner: Option<Uid>,
    group: Option<Gid>,
    flag: FchownatFlags
) -> Result<()>
Expand description

Change the ownership of the file at path to be owned by the specified owner (user) and group.

The owner/group for the provided path name will not be modified if None is provided for that argument. Ownership change will be attempted for the path only if Some owner/group is provided.

The file to be changed is determined relative to the directory associated with the file descriptor dirfd or the current working directory if dirfd is None.

If flag is FchownatFlags::NoFollowSymlink and path names a symbolic link, then the mode of the symbolic link is changed.

fchownat(None, path, mode, FchownatFlags::NoFollowSymlink) is identical to a call libc::lchown(path, mode). That’s why lchmod is unimplemented in the nix crate.

References

fchownat(2).