P
Patrick Flaherty
Hi,
Using perl to archive a bunch of things in a bunch of locations (into a ZIP
file).
Was using functions (for each tree) such as this:
sub process_file_develtree {
$this_file = $File::Find::name;
if ($this_file =~ m/.*\.(bas$|cpp$|pl$|[ce]$|xml$|sql$|vba$|vbs$)/i) {
print $this_file . "\n";
$zip->addFile($this_file);
}
}
The above, I found, gave me absolute pathnames in the ZIP file. And on my
target machine I never found a way of unziping except to do an unzip -l. Get
the name and then extract to stdout and capture the file that way.
Looking then more closely at the ZIP module, it _seems_ the only way to get
relative pathnames is to use
$zip->addTreeMatching( '.', undef,
'\.(bas$|cpp$|pl$|[ce]$|xml$|sql$|vba$|vbs$)'; );
The undef being the key (to relative pathnames).
This works. But it seems _much_ slower.
Explanations? Ideas?
thanx.
pat
Using perl to archive a bunch of things in a bunch of locations (into a ZIP
file).
Was using functions (for each tree) such as this:
sub process_file_develtree {
$this_file = $File::Find::name;
if ($this_file =~ m/.*\.(bas$|cpp$|pl$|[ce]$|xml$|sql$|vba$|vbs$)/i) {
print $this_file . "\n";
$zip->addFile($this_file);
}
}
The above, I found, gave me absolute pathnames in the ZIP file. And on my
target machine I never found a way of unziping except to do an unzip -l. Get
the name and then extract to stdout and capture the file that way.
Looking then more closely at the ZIP module, it _seems_ the only way to get
relative pathnames is to use
$zip->addTreeMatching( '.', undef,
'\.(bas$|cpp$|pl$|[ce]$|xml$|sql$|vba$|vbs$)'; );
The undef being the key (to relative pathnames).
This works. But it seems _much_ slower.
Explanations? Ideas?
thanx.
pat