Skip to main content

open_file

Function open_file 

Source
pub fn open_file(path: &Path, want: IoMode) -> Result<(Box<dyn FileIo>, IoMode)>
Expand description

Open path, asking for want. Returns the mode ACTUALLY obtained.

A platform that cannot give unbuffered I/O gets buffered I/O and says so. It must never silently behave like a different engine — that failure mode (an mmap path returning None on Windows, every index quietly falling back to resident) is exactly what this return value exists to prevent.