15 Replies - 469 Views - Last Post: 27 December 2012 - 08:13 PM
#1
Unzip folder keeping folder structure
Posted 26 December 2012 - 11:28 AM
I'm trying to unzip an application, but every method I've tried either doesn't keep the folder structure, or doesn't unzip all the files.
I've tried using SharpZipLib.dll, Ionic.dll, zipUnzip.dll, and one other, but I forgot it's name.
I should point out that SharpZipLib didn't have any of the issues I mentioned above; instead it put my project directory in front of the input and output directories. I don't understand why...
Anyway, I'm hoping somebody can suggest another library to try, or give me some tips on using one of the libraries I mentioned above.
Thanks for your time! - Gibson
Replies To: Unzip folder keeping folder structure
#2
Re: Unzip folder keeping folder structure
Posted 26 December 2012 - 11:47 AM
nor does putting a directory "in front of" something else.
I can't make heads or tails out of what is really happening on your system. Do you have a screen shot so we can all see what you see?
#3
Re: Unzip folder keeping folder structure
Posted 26 December 2012 - 02:06 PM
Part of responsibility one takes on when using an open source library is learning how to use it properly. That involves reading the documentation that comes with it, and if poorly documented, digging into the source code itself.
#4
Re: Unzip folder keeping folder structure
Posted 26 December 2012 - 02:19 PM
#5
Re: Unzip folder keeping folder structure
Posted 27 December 2012 - 02:45 PM
tlhIn`toq, on 26 December 2012 - 11:47 AM, said:
nor does putting a directory "in front of" something else.
I can't make heads or tails out of what is really happening on your system. Do you have a screen shot so we can all see what you see?
By "unzip an application", I mean an application file. I say that specifically because on Mac all the data for an application is stored with the executable in a directory. That directory is given the extension ".app", and closed (if you open the directory, you open the app instead).

By "putting a directory in front of something else", I mean I can give it the directory "/Users/Gibson/Desktop", and it will put "/Users/GibsonBethke/Documents/Projects/Unity/Current/UnityMusicPlayer/Automatic Updater" in front of that, resulting in "/Users/GibsonBethke/Documents/Projects/Unity/Current/UnityMusicPlayer/Automatic Updater\Users\GibsonBethke\Desktop\UnityMusicPlayer.app\". Also, I just noticed that it's changing the path separator character.

Thanks for your input!
Skydiver, on 26 December 2012 - 02:06 PM, said:
Part of responsibility one takes on when using an open source library is learning how to use it properly. That involves reading the documentation that comes with it, and if poorly documented, digging into the source code itself.
I'm using the example that the developer provided.
void Start ()
{
using (ZipFile zipfile = ZipFile.Read("/Users/GibsonBethke/Desktop/UnityMusicPlayer.zip"))
{
foreach (ZipEntry entry in zipfile)
{
entry.Extract("/Users/GibsonBethke/Desktop", ExtractExistingFileAction.OverwriteSilently);
}
}
}
Skydiver, on 26 December 2012 - 02:19 PM, said:
I haven't been able to find ZipFile.ExtractAll, could you provide a little more information on that?
Thanks for all your willingness to help, guys! I hope I've cleared some of the confusion up; if not, please let me know!
#6
Re: Unzip folder keeping folder structure
Posted 27 December 2012 - 02:58 PM
#7
Re: Unzip folder keeping folder structure
Posted 27 December 2012 - 03:06 PM
I'd try making all this work on Windows first. Learn the oddities of the library you're using under known-working conditions. *THEN* port it to Mac under Mono.
#8
Re: Unzip folder keeping folder structure
Posted 27 December 2012 - 03:56 PM
tlhIn`toq, on 27 December 2012 - 02:58 PM, said:
Yeah, that's a good idea, thanks for the tip!
tlhIn`toq, on 27 December 2012 - 03:06 PM, said:
I'd try making all this work on Windows first. Learn the oddities of the library you're using under known-working conditions. *THEN* port it to Mac under Mono.
Well, I don't have a windows to use, so using Mono on Mac is the best I can do.
I've been using Mono for over two years, and I haven't had any issues; I don't really think that Mono is causing it, although I guess I can't be sure.
Anyway, thanks.
#9
Re: Unzip folder keeping folder structure
Posted 27 December 2012 - 05:41 PM
AVividLight, on 27 December 2012 - 04:45 PM, said:
Skydiver, on 26 December 2012 - 02:19 PM, said:
I haven't been able to find ZipFile.ExtractAll, could you provide a little more information on that?
Thanks for all your willingness to help, guys! I hope I've cleared some of the confusion up; if not, please let me know!
Try this link: http://dotnetzip.her...b5e01afe602.htm
It it is referenced from: http://dotnetzip.cod...m/documentation
#10
Re: Unzip folder keeping folder structure
Posted 27 December 2012 - 06:04 PM
AVividLight, on 27 December 2012 - 04:56 PM, said:
I've been using Mono for over two years, and I haven't had any issues; I don't really think that Mono is causing it, although I guess I can't be sure.
Had you considered installing Windows on the Mac?
http://support.apple.com/kb/HT1461
You can then boot to either OS. Plus you can then use Visual Studio to do your development in. I'm not even sure *how* you are developing for C# without using the IDE that was built for it. What program on the Mac are you using to build this C#/mono application?
#11
Re: Unzip folder keeping folder structure
Posted 27 December 2012 - 06:30 PM
tlhIn`toq, on 27 December 2012 - 06:04 PM, said:
I'm using the Unity3d engine.
Skydiver, on 27 December 2012 - 05:41 PM, said:
It it is referenced from: http://dotnetzip.cod...m/documentation
The page doesn't load due to the server not responding. Does it work for you? If it does, can you copy/paste the main text you want me to see?
#12
Re: Unzip folder keeping folder structure
Posted 27 December 2012 - 06:36 PM
Go to dotnetzip.codeplex.com. Click on the Documentation tab. Click on the "Reference Doc" link. Dig down to Reference>Ionic.Zip namespace>ZipFile class>ExtractAll() method>ExtractAll Method(path)
#13
Re: Unzip folder keeping folder structure
Posted 27 December 2012 - 06:45 PM
Skydiver, on 27 December 2012 - 06:36 PM, said:
Go to dotnetzip.codeplex.com. Click on the Documentation tab. Click on the "Reference Doc" link. Dig down to Reference>Ionic.Zip namespace>ZipFile class>ExtractAll() method>ExtractAll Method(path)
I've tried that a number of times, and the page always returns with a "server not responding" error. I could try to go through a proxy, but I can assure you I do know how to read documentation.
Anyway, thanks for help so far!
I should add that I've tried accessing the documentation for DotNetZip all week, and haven't had any other results.
#14
Re: Unzip folder keeping folder structure
Posted 27 December 2012 - 06:50 PM
Anyway, all the documentation indicates is that you pass in the target path where to expand to. If it doesn't expand properly, then it's a bug in the library. But since it's open source you should be able to trace through the code, find the problem, and hopefully submit a patch to fix it.
#15
Re: Unzip folder keeping folder structure
Posted 27 December 2012 - 07:34 PM
By the way, what application would open a .chm file?
Well, never mind; I've downloaded an application for this purpose.
|
|

New Topic/Question
Reply



MultiQuote




|