Function lrs::file::can_access

Checks whether a file can be accessed with a certain mode.

Syntax

fn can_access<P>(path: P, mode: AccessMode) -> Result<bool, Errno>
    where P: ToCString,

Arguments

NameDescription
path

The path of the file to be checked.

mode

The mode we want to access the file with.

Return value

Returns true if the file can be accessed with the specified mode, false otherwise.

Remarks

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

See also