Crate rsync

Source
Expand description

LibRsync

§Examples

In the following example, the signature file should be computed on the local file, sent to the remote machine where the delta is computed. Then, delta_file must be run on the remote machine, creating a file /tmp/delta. Then, /tmp/delta should be copied to the local machine, and finally patch_file must be applied to write a copy of the remote file in /tmp/new.

extern crate rsync;
use rsync::*;

fn main(){
    sig_file("/tmp/old","/tmp/old.sig",2048,8,None).unwrap();
    let sig=loadsig_file("/tmp/old.sig",None).unwrap();
    delta_file(&sig, "/tmp/new", "/tmp/delta",None).unwrap();
    patch_file("/tmp/old","/tmp/delta","/tmp/new.new",None).unwrap();
}

Structs§

Signature
rs_stats_t

Enums§

Error

Functions§

delta_file
Produce a delta from a signature and a “new” file.
loadsig_file
Loads a signature from “sig_file”.
patch_file
Applies a delta file (or a “patch”) to “old_file”, and write the result to “new_file”.
sig_file
Generates a signature of the “old_file” input file and writes it to “signature_file”.
sumset_dump