Function base::sys::unix::open_file

source ·
pub fn open_file<P: AsRef<Path>>(path: P, options: &OpenOptions) -> Result<File>
Expand description

Open the file with the given path, or if it is of the form /proc/self/fd/N then just use the file descriptor.

Note that this will not work properly if the same /proc/self/fd/N path is used twice in different places, as the metadata (including the offset) will be shared between both file descriptors.