Method lrs::file::File::open_read

Opens a file in read-only mode.

Syntax

impl File {
    fn open_read<P>(path: P) -> Result<File, Errno>
        where P: ToCString,
}

Arguments

NameDescription
path

The path of the file to be opened.

Return value

Returns the opened file.

Remarks

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.

See also