This site is no longer active and is available for archival purposes only. Registration and login is disabled.

ZLib question


ZLib question

Postby PDAFantast » Oct 9, 2001 @ 7:27pm

Zlib fantasts...<br><br>Is there a way to get the size of the uncompressed file inside a zip ?<br><br>gzseek(...,SEEK_END);<br>gztell();<br><br>approach doesn't work, since gzseek doesn't support SEEK_END.<br><br>Any other way to do this ?<br><br>PDAFantast.
PDAFantast.
PDAFantast
pm Member
 
Posts: 244
Joined: Jun 27, 2001 @ 4:00pm
Location: Malmö, Sweden


Re: ZLib question

Postby Dan East » Oct 9, 2001 @ 7:46pm

When you seek in zlib, you decompress. So reading and seeking are the same performance-wise. Also, if you seek backwards, zlib resets to the beginning of the file, and decompresses all the way up to the new desired file pointer. That is why Pocket Quake loads gzipped data files so slow. So you might as well just read the whole file and count the bytes as you go to get the file size. If performance is an issue then you really should store the original file size, either in a custom header in the gzip, or in a seperate info file, etc.<br><br>Dan East
User avatar
Dan East
Site Admin
 
Posts: 5264
Joined: Jan 25, 2001 @ 5:19pm
Location: Virginia, USA


Re: ZLib question

Postby PDAFantast » Oct 11, 2001 @ 9:02pm

Thanks Dan.<br><br>The problem is that I need to know the size of the uncompressed file before I even do anything with the file. Sure I can read it twice.. but ehm.. that's not a good idea.. I'm planning on allowing the roms to be zipped. Unfortunately, there is no size description inside the ROMS themselves whatsoever, so... eh well.<br>
PDAFantast.
PDAFantast
pm Member
 
Posts: 244
Joined: Jun 27, 2001 @ 4:00pm
Location: Malmö, Sweden


Return to Windows Mobile


Sort


Forum Description

A discussion forum for mobile device developers on the Windows Mobile platform. Any platform specific topics are welcome.

Moderators:

Dan East, sponge, Digby, David Horn, Kevin Gelso, RICoder

Forum permissions

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

cron