This is from the POD:

:
:
DESCRIPTION

The Archive::Zip module allows a Perl program to create, manipulate, read, and write Zip archive files.

Zip archives can be created, or you can read from existing zip files.

Once created, they can be written to files, streams, or strings. Members can be added, removed, extracted, replaced, rearranged, and enumerated. They can also be renamed or have their dates, comments, or other attributes queried or modified. Their data can be compressed or uncompressed as needed.
:
:
So the POD seems to indicate that removal and rename capabilities are provided.

All of the examples I have seen are for removing files, not directories. All of the examples I have seen for renaming are renaming while storing to a Zip file or retrieving from a Zip file. Both of which I am not doing. Considering the size of these files/directories (~0.6GB for the zip), I do not want to do it that way (i.e., unzip, rename, zip, etc.).

BTW - renaming is a fall back position, I would much rather remove the directory.

This is one of the many ways I've tried to remove a directory:

# $NewMemberName looks like # 'MyLabNotebook/Default/{A8C57B20-DFBD-492D-A4F7-B83D84D18CDA}' if (!defined($zipA->removeMember($NewMemberName))) { die "**Fatal error, can't remove (ZipA; \"$NewMemberName\")"; }
The variable $NewMemberName is generated by another Perl program and stored in a CSV file. I then read the CSV and use it here. This code does NOT, by-the-way, remove the member as it seems it should. And yes, I do validate the name to make sure it is truly in the Zip file.

The major complication is caused by the person who wrote the application that generates the Zip files. For whatever reason, they decided to name the folders with a very long string of arbitrary characters. So to know what order to process the data, the files in each folder have to the accessed and analyzed to decide the relationship among all the directories in the Zip file. Screwy, but I'm stuck with it.

Any help would be appreciated...

Thanks,
  EigenFunctions
  OpSys: Win7 Professional/Home Premium x64 Service Pack 1


In reply to Re^4: Remove an existing, non-empty, directory re: Archive::Zip by EigenFunctions
in thread Remove an existing, non-empty, directory re: Archive::Zip by EigenFunctions

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.