Hello,

I'm using SimpleZip to backup all my files/folders in a directory. I'm using the following code that working fine:

find( sub { eval {$zip->add($_, Name => $File::Find::name) or warn "Cannot add '$_' to zip file: $SimpleZipError\n" ;}; warn $@ if $@ }, $data);

The problem is as follow, this is how I understand it: When Find go through the folder it create the first pass for all files, then adding the files one by one in the Zip file. We have large files that will take time to be added to the Zip file, if during time the large file is getting add to the zip file, one of the temporary file get remove by another process, when it's time to add this remove file to the zip, all other files will failed. then I'm getting the following error:

Example:

Cannot add 'File1' to zip file: File 'File_that_Was_Remove' does not exist

Cannot add 'File2' to zip file: File 'File_that_Was_Remove' does not exist

Cannot add 'File3' to zip file: File 'File_that_Was_Remove' does not exist

It's like if the $_ value is correct but it report the error that it cannot find the file $File::Find::name (stuck on the file that was removed), then the script end. Only the files from the FIND order was added up to the file that was removed.

Hope that make sense.

I would like to skip the deleted file in the FIND order when it try to add the deleted file in the SimpleZip.

Thanks,

Alex


In reply to SimpleZip If file doesn't exist by AlexandreG

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.