![]() |
|
"be consistent" | |
PerlMonks |
Re^2: unzipping files with .gz extensionby afoken (Abbot) |
on Dec 29, 2012 at 20:29 UTC ( #1010851=note: print w/replies, xml ) | Need Help?? |
Most tar commands also unzip files (and can create them): for unzipping, tar xvzf yourfile.gz will probably work on Linux and a lot of other Unix systems without going near Perl. Its a bit dirty, but if you are doing it in a Perl script, you can do that as a system command enclosed in backticks. However the other methods suggested are much more preferable if you are doing this within Perl. This is nonsense! GNU tar can decompress on the fly, but it DOES NOT decompress non-tar files:
If you choose to use external tools, use the proper tools. tar is the wrong tool for handling arbitary gzip-compressed files. gzip with the -d switch, gunzip, and zcat are the right tools. Alexander
-- Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
In Section
Seekers of Perl Wisdom
|
|