I just added an Intermediate Windows Skills course to our curriculum at the library, and one of the topics covered is software installation, and so something to extract ZIP files is needed, so that the participants can have practice installing software that comes packaged in a ZIP file. As I was checking the computers we use for the courses to make sure they're ready, I noticed one Win98 machine didn't have a simple ZIP file extractor. (It did have something, but it wasn't something I wanted to explain the use of within the course.) I tried installing PKWare's Reader, but it complained about a misssing DLL. I didn't feel like messing with it, and I remembered that I already had Archive::Zip installed on there (because it's used by the word search maker for creating an OpenOffice document), and so I just associated ZIP files with this simple Perl script:
#!/usr/bin/perl use Archive::Zip; for (@ARGV) { print "Unzipping: $_\n" if $debug; my $zip = Archive::Zip->new($_) or die "Unable to open $_: $!"; for my $m ($zip->members()) { print " Member: ".Dumper($m)."\n" if $debug; # $m is an object of class Archive::Zip::ZipFileMember print " ".$m->fileName()."$/"; $zip->extractMember($m); } }
This doesn't have a lot of features, but it does what we need for this course (double-click a ZIP file in Windows Explorer, and its contents are spilled out on the spot), and writing and installing it was faster than trying to solve the problem with the PKWare Reader.
$;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple ZIP extractor
by b10m (Vicar) on Dec 22, 2003 at 21:24 UTC | |
by jonadab (Parson) on Dec 25, 2003 at 13:01 UTC | |
|
Re: Simple ZIP extractor
by nimdokk (Vicar) on Dec 23, 2003 at 18:32 UTC | |
by rjamestaylor (Acolyte) on Dec 28, 2003 at 22:26 UTC | |
|
Re: Simple ZIP extractor
by b10m (Vicar) on Feb 20, 2004 at 11:17 UTC |