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:
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.