 <p>You may want to look unto how the <a href="http://en.wikipedia.org/wiki/Rsync" rel="nofollow noreferrer"><code>rsync</code></a> protocol works on Unix. It essentially computes the differences between two files and uses that to create a compressed delta used to compute the changes.</p> <p>You may be able to adapt that to what you're trying to do.</p>