Operating System - OpenVMS
1834374 Members
2104 Online
110066 Solutions
New Discussion

Never ending ZIP process ...

 
SOLVED
Go to solution
Steven Schweda
Honored Contributor

Re: Never ending ZIP process ...

> - Create a list of files you want to ZIP.
> Use it by supplying the /BATCH=listfile.txt
> qualifier.

Is that really faster than an equivalent
wildcard, or were you just looking for
finer-grained control over the list?

> - Use the /MOVE qualifier to automatically
> delete the files from disk after they have
> been added to the archive

Zip does try to be careful, but you have more
confidence in this stuff than I. And, I'd
expect one of the more clever DELETE schemes
to be faster at removing the files than Zip.
Art Wiens
Respected Contributor

Re: Never ending ZIP process ...

I don't think using the list was any faster. Performing the zip in a temporary directory was the biggest help in that respect. I renamed three months worth into the temp dir and zipped up a months worth at a time. There is nothing in the filename to indicate which month it's from, and making ZIP look up dates seemed to me like it would add unnecessary overhead, so using list files was my control over which files to ZIP.

WRT confidence ... ZIP/UNZIP have never let me down (on any platform)! First time for everything I guess.

Cheers,
Art
Hein van den Heuvel
Honored Contributor

Re: Never ending ZIP process ...

fwiw, I seem to have posted an intermediate version of the double rename solution.
Almost right, but not taking from the end towards forwards.
Which was the whole point! Ooops

Here is the corrected example
It's just an example, with some debugging lines still there to help understand it.
Adapt to individual needs and perl quirks trying to help with files and filenames.
Or re-write to something similar in DCL.

See also c.o.v discussion: "Which delete statement is faster? Options "

http://groups.google.com/group/comp.os.vms/browse_thread/thread/cfaed0f141068b51?hl=en#

Hein.

use strict;
#use warnings;

my $HELPER = "[-.tmp_helper]";
my $TARGET = "[-.tmp_renamed]";
my $i = 0;
my @files;
$_ = shift or die "Please provid double quoted wildcard filespec";

print "wild: $_\n";
s/"//g;
my $wild = $_;
foreach (qx(DIRECTORY/COLU=1 $wild)) {
chomp;
$files[$i++] = $_ if /;/;
}
die "Please provide double quoted wildcard filespec" if @files < 2;

# phase 1

$i = @files;

print "Moving $i files to $HELPER\n";

while ($i-- > 0) {
my $name = $files[$i];
my $new = sprintf("%s%06d%s",$HELPER,999999-$i,$name);
print "$name --> $new\n";
rename $name, $new;
}

system ("DIRECTORY $HELPER");
# phase 2

print "Renaming from $HELPER to $TARGET...\n";

while ($i++ < @files) {
my $name = $files[$i];
rename sprintf("%s%06d%s",$HELPER,999999-$i,$name), $TARGET.$name;
}


Hope this help better :-)

Hein.