Function open_regular_file
pub fn open_regular_file(path: &Path) -> Result<File, Error>Expand description
Open a chosen local path without following its final component and verify the resulting descriptor is a regular file. Checking metadata on the open descriptor, rather than the path, keeps the type check bound to exactly what is handed to the caller.
Android’s SAF view path also opens an already-chosen local file this way before handing the descriptor to the system viewer.
§Errors
Returns when the path cannot be opened without following a final symlink, or when the opened descriptor is not a regular file.