You should also consider using incremental backups.
I published some optimized version control features for our SynProject Open Source tool. The TVersions class in the ProjectVersioning block allows you to store diff binaries in a zip container.
Our patented, but faster than zip SynLZ algorithm is used to store additional differences. This works well in practice.
See the TVersions.FillStrings method for retrieving a list of files to be updated.
Remember that you may find a one-hour difference, depending on the current summer time. Here's how we allow date comparisons:
function SameFileDateWindows(FileDate1,FileDate2: integer): boolean; // we allow an exact one Hour round (NTFS bug on summer time zone change) begin dec(FileDate1,FileDate2); result := (FileDate1=0) or (FileDate1=1 shl 11) or (FileDate1=-(1 shl 11)); end;
We do not read the contents of the file here. For backup purposes, it is enough to rely on the file date to mark the file for comparison. Then a differential diff is performed for both versions of the file. If the contents of the file match, it will only save the date difference.
IMHO, you should not use the patented madzip container, but a standard one, for example .zip. There are several options, including our version used in SynProject or our ORM. It is faster than MadZip and decompression in optimized asm. See SynZip device for low-level compression and a simple .zip reader and writer, as well as more advanced classes in SynZipFiles (used in SynProject). For a clean version of Delphi, like madzip, check out the PasZip block, which is faster than madzip (but PasZip will not compile with Unicode Delphi, whereas SynZip does).
source share