How can one detect the type of compression used on the file? (assuming that .zip, .gz, .xz or any other extension is not specified).
Is this information stored somew
If you're on a Linux box just use the 'file' command.
http://en.wikipedia.org/wiki/File_(command)
$ mv foo.zip dink $ file dink dink: gzip compressed data, from Unix, last modified: Sat Aug 6 08:08:57 2011, max compression $