aehobak 0.0.6

Transcoder for bsdiff binary patches.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
fn main() {
    let args: Vec<String> = std::env::args().collect();
    if args.len() != 4 {
        println!("Usage: patch <ORIGFILE> <PATCHFILE> <FILE>");
        return;
    }
    patch_file(&args[1], &args[2], &args[3]).unwrap();
}

fn patch_file(orig_file: &str, patch_file: &str, file: &str) -> std::io::Result<()> {
    let old = std::fs::read(orig_file)?;
    let patch = std::fs::read(patch_file)?;
    let mut new = Vec::new();

    aehobak::patch(&old, &patch, &mut new)?;
    std::fs::write(file, &new)
}