Method lrs::file::File::open

Opens a file with custom flags.

Syntax

impl File {
    fn open<P>(path: P, flags: FileFlags, mode: Mode) -> Result<File, Errno>
        where P: ToCString,
}

Arguments

NameDescription
path

The path of the file to be opened.

flags

The flags to be used when opening a file.

mode

The mode a new file has.

Return value

Return the opened file.

Remarks

The mode argument is ignored unless a new file is created via the FILE_CREATE or the FILE_TEMP flags.

If the path is relative, it is interpreted relative to the current working directory.

Unless lrs was compiled with the no-auto-cloexec flag, the opened file always has the O_CLOEXEC flag set.

See also