On 19/10/2011 22:47, Zbiggy wrote:
> Well, tried it again; like before, it returns no zipfile-comment. Although
> it properly recognizes size and packed file name. Tried it using "Example of
> use" from the mentioned page.
There can be comments on both the overall archive and on the individual
files. (Under the assumption that $z holds the name of an instance of a
Zip object,) [$z comment] returns the whole archive comment, and [$z
comment $file] returns the comment associated with a particular file; I
tried to make the usage of the API as obvious as possible.
I tested it with ZIP files created with both my system 'zip' command
(which is how I tested the comments) and with Java's 'jar' tool. These
are independent implementations, so I assume that if I can read both of
their output, my code is correct. :-) Note however that Java's 'jar'
tool does not produce comments at all, so I couldn't check that
particular combination.
Perhaps your sample zip file just doesn't have any comments? Or maybe
they're packed somehow into the 'extra' info field, which I don't parse
at all. (The ZIP spec is really quite complicated when you get into the
details, and not everything is actually documented apparently.)
Donal.