Function bsa::open[][src]

pub fn open<P: AsRef<Path>>(path: P) -> Result<Bsa, ReadError>

Opens the specified BSA file.

use std::error::Error;

fn main() -> Result<(), Box<dyn Error>> {
    let mut bsa = bsa::open("file.bsa")?;
    for folder in bsa.folders() {
        for file in folder.files() {
            println!("File {:?} in folder {:?}", file.name(), folder.name());
            let contents = file.read_to_vec(&mut bsa)?;
            println!("{:?}", &contents);
        }
    }
    Ok(())
}