keienn has asked for the wisdom of the Perl Monks concerning the following question:
Great Monks!
I am trying to unzip some .txt files using IO::Uncompress::Unzip in the code snippet below. Am getting this error though, which i suspect is to do with unseen folders in windows;
.
Use of uninitialized value $_1 in string eq at C:/Strawberry/perl/lib/IO/Compress/Base/Common.pm line 280.
unzip failed: input file '.' is a directory
Below is the code
opendir(ZIPPED, $zipdir)or die "couldn't open $zipdir: $!\n"; my @zd = readdir(ZIPPED); my @uzd; foreach(@zd) { my $inf = $_; my $outf = $uzd[@uzd]; # print $_,"\n"; unzip $inf => $outf or die "unzip failed: $UnzipError\n"; }
Below is sample of the output i get if i run the print line and comment out the unzip line;
.
..
730372_Atoll.zip
730376V01_Atoll.zip
730378V01_Atoll.zip
730691_Atoll.zip
732689_Atoll.zip
732690_Atoll.zip
732691_Atoll.zip
How can i get past the "." and ".." and get unzip to uncompress the files. Thanks!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: unzip fail using IO::Uncompress::Unzip
by Marshall (Canon) on Sep 23, 2016 at 17:05 UTC | |
by keienn (Novice) on Sep 27, 2016 at 09:01 UTC | |
by Marshall (Canon) on Sep 29, 2016 at 19:37 UTC | |
by Anonymous Monk on Sep 27, 2016 at 09:35 UTC | |
|
Re: unzip fail using IO::Uncompress::Unzip
by toolic (Bishop) on Sep 23, 2016 at 16:38 UTC | |
|
Re: unzip fail using IO::Uncompress::Unzip
by Anonymous Monk on Sep 23, 2016 at 17:51 UTC |