Phantom - a phantomblock generator (sparse files)

This tool removes blocks of 0x00 from files by replacing them with phantomblocks. That way, a file uses less diskspace while its contents hasn't changed at all!

Beware: after copying these files with tar, cp, cpio or any other tool, the phantomblocks have been replaced with 0x00-blocks again!
This program should work not only on Linux but on Solaris as well (2.6 at least).
Version 1.1 implements a new "replace" option, so that one could do, for example the following:

find ~ -type f -print | xargs -n 1 phantom
This would go trough your whole home-folder, scaning all files and generate 0x00-blocks where necessary.




2.0 rewritten. slightly faster
1.2 setuid and such is now correctly set on the new file
1.1 added "replace" option


Thanks to Otto Vox for some enhancements and fixes.