Browser a folder compressed in zip!!

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
theHobbit
Posts: 65
Joined: Sat Sep 30, 2006 5:26 am

Browser a folder compressed in zip!!

Post by theHobbit »

Hi, Anyone knows a way to browser a folder that is compressed in a zip?

I'm using the unzip library to browse a zip file, but what happens if there is a folder in the zip file and i wan't to see what files are inside that folder. Do I have to uncompress all the folder first? Well hope someone can help? Thanks in advance!!
Yodajr
Posts: 13
Joined: Sat Sep 24, 2005 7:04 pm

Post by Yodajr »

I'm using the unzip library to browse a zip file
Sorry for that, but how do you do that ? ;)
Tutorials about OSLib here
User avatar
Jim
Posts: 476
Joined: Sat Jul 02, 2005 10:06 pm
Location: Sydney
Contact:

Post by Jim »

Tong
Posts: 10
Joined: Fri Apr 20, 2007 2:55 pm

Post by Tong »

The unzip library (which one do you use? I use the one created by Gilles Vollant) organizes folders and files in the form of a linear list instead of a tree list.

Suppose I have a zip file containing the following folders and files:

Code: Select all

	[+]My folder
		*Main.cpp
		*Tex.png
		[+]Scrshot
			*Scrshot001.png
	[+]My App
		*Eboot.pbp
Where [+] denote a folder and * denote a file.

When I browse the zip file using unzGoToFirstFile followed by unzGoToNextFile and unzGetCurrentFileInfo continuously, I will get some entries with the following filenames:

Code: Select all

My folder/
My folder/Main.cpp
My folder/Tex.png
My folder/Scrshot/
My folder/Scrshot/ Scrshot001.png
My App/
My App/Eboot.pbp
Then, you can create your own tree list using these filenames. The hint is that, all folder entries are with uncompressed size 0B.

After creating the tree list, you can select whatever folders you want and display the files inside.
Hope this can help you.
Post Reply