fn open_noatime(path: &Path) -> io::Result<File> {
    let path = path.to_path_buf();
    let mut options = OpenOptions::new();
    options.read(true);
    #[cfg(target_os = "linux")]
    {
        let mut noatime_opts = options.clone();
        noatime_opts.custom_flags(libc::O_NOATIME);
        noatime_opts
            .open(&path)
            // opening with O_NOATIME may fail in some cases for security reasons
            .or_else(|_| options.open(&path))
    }
    #[cfg(not(target_os = "linux"))]
    {
        options.open(&path)
    }
}
/// Opens a file for read. On unix systems passes O_NOATIME flag to drastically improve
/// performance of reading small files.
Opens a file for read. On unix systems passes O_NOATIME flag to drastically improve
performance of reading small files.
Opens a file for read . On unix systems passes O_NOATIME flag to drastically improve performance of reading small files .
fn open_noatime(path: &Path) -> io::Result<File> {
    let path = path.to_path_buf();
    let mut options = OpenOptions::new();
    options.read(true);
    #[cfg(target_os = "linux")]
    {
        let mut noatime_opts = options.clone();
        noatime_opts.custom_flags(libc::O_NOATIME);
        noatime_opts
            .open(&path)
            // opening with O_NOATIME may fail in some cases for security reasons
            .or_else(|_| options.open(&path))
    }
    #[cfg(not(target_os = "linux"))]
    {
        options.open(&path)
    }
}
fn open_noatime ( path : & Path ) -> io :: Result < File > { let path = path . to_path_buf ( ) ; let mut options = OpenOptions :: new ( ) ; options . read ( true ) ; # [ cfg ( target_os " " ) ] { let mut noatime_opts = options . clone ( ) ; noatime_opts . custom_flags ( libc :: O_NOATIME ) ; noatime_opts . open ( & path ) // opening with O_NOATIME may fail in some cases for security reasons . or_else ( | _ | options . open ( & path ) ) } # [ cfg ( not ( target_os " " ) ) ] { options . open ( & path ) } }
Opens a file for read.
Opens a file for read .
path
&Path
path
&Path