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.
In reply to Re: Getting IO::Compress::Zip to include directory entries (on Windows)
by dasgar
in thread Getting IO::Compress::Zip to include directory entries (on Windows)
by hilitai
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |