/// Opens a file and positions it at the given offset.
/// Additionally, sends the advice to the operating system about how many bytes will be read.
Opens a file and positions it at the given offset.
Additionally, sends the advice to the operating system about how many bytes will be read.
Opens a file and positions it at the given offset . Additionally sends the advice to the operating system about how many bytes will be read .
fn open(path: &Path, offset: FilePos, len: FileLen, cache_policy: Caching) -> io::Result<File> {
    let mut file = open_noatime(path)?;
    configure_readahead(&file, offset, len, cache_policy);
    if offset > FilePos::zero() {
        file.seek(offset.into())?;
    }
    Ok(file)
}
fn open ( path : & Path , offset : FilePos , len : FileLen , cache_policy : Caching ) -> io :: Result < File > { let mut file = open_noatime ( path ) ? ; configure_readahead ( & file , offset , len , cache_policy ) ; if offset > FilePos :: zero ( ) { file . seek ( offset . into ( ) ) ? ; } Ok ( file ) }
Opens a file and positions it at the given offset.
Opens a file and positions it at the given offset .
path
&Path
offset
FilePos
len
FileLen
cache_policy
Caching