in reply to How do you get IO::Uncompress::Gunzip to error if the input file isn't a GZ file?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do you get IO::Uncompress::Gunzip to error if the input file isn't a GZ file?
by afoken (Chancellor) on Jun 20, 2020 at 14:20 UTC |