Thread overview | |||||
---|---|---|---|---|---|
|
June 10, 2006 ZipArchive doesn't generate valid zip files | ||||
---|---|---|---|---|
| ||||
What the subject says. It can read well, though, but it can't even read it's own files. //-------------------------------- import std.date; import std.zip; void main () { static ubyte [] buf = [1,2,3,4,5,0,7,8,9]; auto ar = new ZipArchive; auto am = new ArchiveMember; // 10 am.name = "buf"; am.expandedData = buf; am.compressionMethod = 8; am.time = toDosFileTime (getUTCtime ()); ar.addMember (am); // 15 auto zip1 = ar.build (); ar = new ZipArchive (zip1); } //-------------------------------- When I run it, I get "Error: ZipException: invalid directory entry 3" (what does that mean, anyway?) If I comment lines 10 to 15 (ie, I don't add a member to the zip, I don't know if that's valid or not), I get "Error: ZipException: no end record". Tested with gdc 0.18 on Mac OS X. -- Carlos Santander Bernal |
June 11, 2006 Re: ZipArchive doesn't generate valid zip files | ||||
---|---|---|---|---|
| ||||
Posted in reply to Carlos Santander | Fixed in svn. This was a Phobos bug -- I have added it to Bugzilla.
Carlos Santander wrote:
> What the subject says. It can read well, though, but it can't even read it's own
> files.
>
> //--------------------------------
> import std.date;
> import std.zip;
>
> void main ()
> {
> static ubyte [] buf = [1,2,3,4,5,0,7,8,9];
>
> auto ar = new ZipArchive;
>
> auto am = new ArchiveMember; // 10
> am.name = "buf";
> am.expandedData = buf;
> am.compressionMethod = 8;
> am.time = toDosFileTime (getUTCtime ());
> ar.addMember (am); // 15
>
> auto zip1 = ar.build ();
>
> ar = new ZipArchive (zip1);
> }
> //--------------------------------
>
> When I run it, I get "Error: ZipException: invalid directory entry 3" (what does
> that mean, anyway?)
>
> If I comment lines 10 to 15 (ie, I don't add a member to the zip, I don't know
> if that's valid or not), I get "Error: ZipException: no end record".
>
> Tested with gdc 0.18 on Mac OS X.
>
|
June 11, 2006 Re: ZipArchive doesn't generate valid zip files | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Friedman | David Friedman escribió: > Fixed in svn. This was a Phobos bug -- I have added it to Bugzilla. > Thanks. -- Carlos Santander Bernal |
Copyright © 1999-2021 by the D Language Foundation