Function openat

fn openat<P: ?Sized + NixPath, Fd: std::os::fd::AsFd>(dirfd: Fd, path: &P, oflag: OFlag, mode: Mode) -> Result<OwnedFd>

open or create a file for reading, writing or executing

The openat function is equivalent to the open function except in the case where the path specifies a relative path. In that case, the file to be opened is determined relative to the directory associated with the file descriptor dirfd.

See Also

openat