Uploaded image for project: 'Zeta Components'
  1. Zeta Components
  2. ZETACOMP-72

Extra empty files added to created zip file when packing directories explicitly

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: Archive
    • Labels:
      None
    • Environment:
      win vista sp2 32bit / php 536

      Description

      When adding a bunch of folders and files to an archive, it's nice to be able to also have empty directories in the archive.
      And it's nice not to have to scan twice the set of files/folders to determine if any folder to be added is empty or not.

      So what I do is:

      • scan recursively a folder for any files + folders in it
      • pass the resulting list to ezcarchive

      What I get is a zip file that, when unzipped, has a 0-byte-sized file next to every folder (note: decompress tested using total commander, that uses under the hood info-zip code afaik. Using vista native unzipping, it's an empty file!)

      I guess this could be fixed by only passing a list of files to the ezcarchive, but I would thus loose empty folders in the archive.

      Reading the zip spec (http://www.info-zip.org/doc/) there seems to be no cler cut indication of empty-folders treatment. Some ppl say to add folders using "/." as filename, some say to use a specific extra_header byte...

        Attachments

        1. ezoracle-2.2.0.zip
          236 kB
          gggeek
        2. testfolder1.zip
          0.1 kB
          gggeek
        3. testfolder2.zip
          0.2 kB
          gggeek

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              gggeek gggeek
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: