Skip to main content

open_far

Function open_far 

Source
pub fn open_far<P: AsRef<Path>>(path: P) -> Result<FarReader<BufReader<File>>>
Expand description

Opens a FAR file for reading.

Convenience function that opens a file and creates a buffered FarReader.

§Arguments

  • path - Path to the FAR file

§Returns

Returns a FarReader ready to read FSTs from the archive.

§Errors

Returns an error if the file cannot be opened or the archive is invalid.

§Examples

use arcweight::io::open_far;

let mut reader = open_far("models.far")?;
for name in reader.list() {
    println!("Found: {}", name);
}