You could use file(1) magic to check if a file is indeed a compressed file before trying to uncompress. For Perl there are File::MMagic and File::LibMagic among other modules to check file MIME type.
In reply to Re: How do you get IO::Uncompress::Gunzip to error if the input file isn't a GZ file?
by parv
in thread How do you get IO::Uncompress::Gunzip to error if the input file isn't a GZ file?
by sectokia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |