Zipping a folder and displaying the completion rate

J

Just in

I'm using Archive::Zip and Archive::Zip::Tree to zip a hefty folder, and its
sub folders. What I'd like to do is display how much has been done.

Since perl executes line by line I was wondering how to display the
percentage completed. I mean nothing is going to execute until these lines
get done:

die "Write error to $ZipFile" if $Zip->addTree($ServerDir) != AZ_OK;

$Zip->writeToFileNamed($ZipFile);

Threads and forks sounded like trees to bark at, but googling hasn't
provided any help as to whether I should or shouldn't. Plus I got put off
with my AS 5.6 and the ithreads argument.

Any pointers appreciated.

Thanks

Just in
 
B

Bill

Just in said:
I'm using Archive::Zip and Archive::Zip::Tree to zip a hefty folder, and its
sub folders. What I'd like to do is display how much has been done.

Since perl executes line by line I was wondering how to display the
percentage completed. I mean nothing is going to execute until these lines
get done:

die "Write error to $ZipFile" if $Zip->addTree($ServerDir) != AZ_OK;

Take a look at $Zip->addTreeMatching; use the optional subroutine to
add the file size to a counter, and display it. Displaying all that
will slow things down a lot of course.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top