Perl Monk, Perl Meditation | |
PerlMonks |
Re: How do you get IO::Uncompress::Gunzip to error if the input file isn't a GZ file?by parv (Parson) |
on Jun 19, 2020 at 04:46 UTC ( [id://11118251]=note: print w/replies, xml ) | Need Help?? |
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 Section
Seekers of Perl Wisdom
|
|