in reply to Getting IO::Compress::Zip to include directory entries (on Windows)
Looking the FilterName option portion of the documentation for IO::Compress::Zip, I was able to figure out a syntax that appeared to work for me.
I created a directory named 'test_dir' and created two text files in that directory. Then I used the following code:
use strict; use warnings; use IO::Compress::Zip qw(:all); my $outfile = "test.zip"; my $dir = "test_dir"; zip [ <$dir/*.txt> ] => $outfile, BinModeIn => 0 or die "zip failed: +$ZipError\n";
When I ran the code, it created a zip file that had a directory named 'test_dir', which in turn contained the two text files. This was done on Windows 7 using Strawberry Perl 5.20.0 and IO::Compress::Zip 2.064.
Hopefully the code above will help point you in the right direction for what you're trying to do.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Getting IO::Compress::Zip to include directory entries (on Windows)
by hilitai (Monk) on Feb 03, 2016 at 00:35 UTC | |
by poj (Abbot) on Feb 03, 2016 at 07:48 UTC | |
by pmqs (Friar) on Feb 03, 2016 at 13:10 UTC | |
by dasgar (Priest) on Feb 03, 2016 at 05:41 UTC |