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();
}