Opens a file in read-only mode.
impl File {
fn open_read<P>(path: P) -> Result<File, Errno>
where P: ToCString,
}| Name | Description |
|---|---|
| path | The path of the file to be opened. |
Returns the opened file.
If the path refers to a symbolic link, the link is recursively resolved and the first non-link target is opened.
If the path is relative, it is interpreted relative to the current working directory.
This is equivalent to File::open with the default flags.
Unless lrs was compiled with the no-auto-cloexec flag, the opened file always has the O_CLOEXEC flag set.