#10 Get list of all files, possibly with additional info

closed
nobody
None
5
2012-01-15
2011-08-29
No

It would get a list of all files from inside the zip archive. So it would be possible to calculate the real size of all files after extraction before you want to extract the archive or only to use this information for other things.

I attached a image how this information can be used (like here at file archiver from Ubuntu)

Discussion

  • Sergey A. Tachenov

    QuaZip::goToNextFile() and QuaZip::getCurrentFileInfo() can do that, or do you want something else?

     
  • Sergey A. Tachenov

    • status: open --> pending
     
  • hans müller

    hans müller - 2011-08-29

    Yes thanks that's true. It does what I want to do but what#s about the whole size of all files inside? Is that information saved in zip files or have I to go through the whole file and read the single file information every time if I want that information.

    By the way a good thing would be to overload ++ and - - operator to go through the file like you know from STL (map, list, ...) structures.

     
  • hans müller

    hans müller - 2011-08-29
    • status: pending --> open
     
  • Sergey A. Tachenov

    Well, I could create some utility method that does just that - goes through all the files and returns something like QList<QuaZipFileInfo>. Will that do?

    The idea about operator overloading is nice, though, but requires some sort of iterator, which QuaZIP doesn't have. And it wouldn't make much of a difference anyway.

     
  • hans müller

    hans müller - 2011-08-29

    One thing more. Please update quazipfileinfo.h comments for doxygen. The description should be more detailed because of the most comments I have no idea what they stand for and what's the detailed structure of the value.

     
  • hans müller

    hans müller - 2011-08-29

    Well, I could create some utility method that does just that - goes through
    all the files and returns something like QList<QuaZipFileInfo>. Will that
    do?

    if you want to create this functionality it would be much easier. Yes you can do that.

     
  • Sergey A. Tachenov

    For some comments I either have no idea what they stand for, like internal/external attributes, extra field and diskNumberStart. Most users have no use for them, though, and those who have can always check ZIP format specification. For other fields, comments are short, but I have no idea what I could add to them. For example, is something unclear about "compressed/uncompressed file size"?

    Okay, I will add getFileInfoList() and getFileNameList(), this is not a problem.

     
  • hans müller

    hans müller - 2011-08-29

    All right add these functions.
    Is it also possible to get a folder structure from a zip file?

     
  • Sergey A. Tachenov

    Folder structure is a bit more difficult since it isn't stored directly in the archive. Instead, a list of relative paths is stored so I would need to deduce the true structure from that list and provide a convenient API to access it. Perhaps some additional class like QuaZipDir similar to QDir is needed, but it will take some time to design and implement.

     
  • Sergey A. Tachenov

    • summary: File size inside --> Get list of all files, possibly with additional info
     
  • Sergey A. Tachenov

    • status: open --> pending
     
  • Sergey A. Tachenov

    I have added getFileInfoList() and getFileNameList() to the QuaZip class, and committed the code into the SVN trunk.

     
  • hans müller

    hans müller - 2011-09-24
    • status: pending --> open
     
  • hans müller

    hans müller - 2011-09-24

    Well, nice methods would be goToNextDirectory(), goToFirstFile(), goToLastFile(), goToFirstDirectory(), goToLastDirectory().

     
  • Sergey A. Tachenov

    As I've said earlier, I can't change semantics of goToFirstFile() for compatibility reason, so I'll probably have to create a QDir-like class for navigating the directory structure.

     
  • Sergey A. Tachenov

    • status: open --> closed
     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks