Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Zip/Unzip Files without .NET 4.5: #ZipLib Not Working


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Drakken255   Members   -  Reputation: 173

Like
0Likes
Like

Posted 20 October 2012 - 10:01 AM

Hello all,

I need to be able to zip and unzip files that are known to be named oddly, and my current method (SharpZipLib and a recursive zip/unzip wrapper) can't do it right. An example would be "aux.class" which is a reserved file name, so File won't write that. I've currently rigged a bit of a renaming system specifically for this file, but I dont like doing that sort of thing, it's just too messy and inefficient having to do special things for one file.

Next, I've noticed that even though the files now unzip and rezip, there is a difference between the original and the rezip. Currently, both the manually unzipped and the programmatically unzipped folders have the same size, but there is a difference of over 90KB between the original and the rezipped files, when done so programmatically. Any difference in zips is highly unacceptable since it's actually a JAR archive I'm messing with.

There is the possibility that I am missing something, so I'll give the benefit of the doubt and post my wrapper here:

Spoiler


If my code is correct, then I can't use SharpZipLib. I need something that can zip and unzip files accurately with no difference between the original and the rezip, no matter the file name, so I'm looking to use something else. Anyone have any ideas on what else to try?

UPDATE: I have switched over to DotNetZip and it does FAR better. The JAR (being Minecraft) actually runs now! The problem now is still that aux.class file. Now, when loading a map, the game will crash with "Incompatible magic value 0 in class file aux" or "ClassDefNotFound for aux" which obviously means it is corrupted somehow, but I just don't know what's going on with it. I have narrowed it down to the fact that done manually, the file will use 313 KB zipped, but after programmatical modification, the file will be only 8. 7-Zip strangely enough shows that each has the same unzipped file size...

Edited by Drakken255, 22 October 2012 - 06:32 AM.


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS