[PATCH] Compressed output files

Joel Votaw jovotaw at cs.nmsu.edu
Tue Jul 2 16:53:02 EST 2002

Attached is a patch that implements compressing output files as they're
written to disk, uzing zlib.  Thus far I've only used it with
synchronizing directories on a single machine.

What seems to work / what's done:

	- Synchronizing directories with all files in the target
	  directory gzip'd.  Files seem to contain the correct data.  Use
	  the option "--gzip-dest".

	- Only transferring files whose checksums are different.
	  Destination files are gunzip'd before their checksums are

	- Added an option "--ignore-sizes", since there is no easy way for
	  the receiver to know the uncompressed size of the files it
	  already has.  For now you have to use --checksum to be sure...

	- Added gzio.c from the latest zlib distribution so we can call
	  gzwrite() etc.

What remains to be done / problems:

	- Needs more testing, especially with remote clients / servers.

	- Batch files are not compressed.

	- Reading compressed files should be implemented in a more generic
	  fashion, perhaps in map_file() and its cousins.  I started
	  working on this but saw that changing map_file() et al. could
	  have far reaching consequences, so I took the easy way out: I
	  just changed the one routine I cared about for now.

	- Add documentation of new options to manpages etc.

	- Find a way to write down the uncompressed file sizes on the
	  receiving side.  Perhaps the least-bad way to do this would be
	  append some rsync-specific data, including uncompressed size, to
	  the end of the gzip'd files.  The receiver could read this in on
	  future runs when it needed to.  Gunzip'ing the file from the
	  command-line would work but would give a "ignoring trailing
	  garbage"  kind of error.

What I've done so far isn't pretty, but I thought I'd send it in in case
someone else finds it useful.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: rsync-2.5.5-jav-20020702.diff.gz
Type: application/octet-stream
Size: 10770 bytes
Url : http://lists.samba.org/archive/rsync/attachments/20020702/6d65e755/rsync-2.5.5-jav-20020702.diff.obj

More information about the rsync mailing list