Discuss zlib Multiple files in one archive in the PHP Development forum on Dev Shed. zlib Multiple files in one archive PHP Development forum discussing coding practices, tips on PHP, and other PHP-related topics. PHP is an open source scripting language that has taken the web development industry by storm.
The ASP Free website provides in-depth information on the latest developer tools available from Microsoft. Our cadre of writers, highly experienced industry experts, reveals the best ways to use established technologies as well as new and emerging technologies. Our coverage of Microsoft's development and administration technologies is among the most respected in the IT industry today.
ASP Free and Iron Speed Designer are giving away $5,500+ in FREE licenses. Iron Speed's RAD CASE toolset can save up to 80% of your coding time. One free license per week, one perpetual license per month! Download and Activate to enter!
Intel® Graphics Performance Analyzers is a powerful tool suite for analyzing and optimizing your games, media, and graphics-intensive applications. Used by some of the best developers on the planet, Intel GPA lets you maximize your app’s performance.
Posts: 344
Time spent in forums: 3 h 48 m 53 sec
Reputation Power: 11
hello,
just wondering where you found the file you attached? Was there any more documentation than what was provided? This will be very helpful, but I was wondering if their was a way to unzip the folder aftwerwards?
Posts: 1,430
Time spent in forums: 17 m 46 sec
Reputation Power: 12
Folks, fyi ...
A gzipped file contains exactly one file. The usual way to use gzip compression on several files is to put them into a tar archive, which can be done using Archive_Tar ( http://www.devshed.com/Server_Side/...File/page1.html) and to compress the tar file.
Posts: 459
Time spent in forums: 2 Days 8 h 4 m 29 sec
Reputation Power: 10
Quote:
Originally posted by realnowhereman Folks, fyi ...
A gzipped file contains exactly one file. The usual way to use gzip compression on several files is to put them into a tar archive, which can be done using Archive_Tar ( http://www.devshed.com/Server_Side/...File/page1.html) and to compress the tar file.
A gzip file consists of a series of "members" (compressed data sets). The format of each member is specified in the following section. The members simply appear one after another in the file, with no additional information before, between, or after them.
Albeit I'll agree that the usual way is to do the tar first, and then gzip the result. And this does also provide proper handling of filenames and directories and stuff.
As for alternatives, it's not so hard to produce a proper zip file, either using the zlib or (gzip on unix when no zlib available), and neither to process this zipped file. For starters on the format to use, see http://www.pkware.com/products/ente...ers/appnote.txt
I've build my own zip/unzip classes already, but they only uses in-memory files, and are not for public view. At least not yet, but I'm seriously thinking of producing zip/unzip classes loosely build on top of zlib. Time will show if I will publish these scripts/classes or not.
But back to the original problem, if adding several members (that is several gzdeflated files) into one file, then you need a proper tool to decompress them, and I'm not sure how zlib handles that. But it's possible, so keep trying.
Posts: 1,430
Time spent in forums: 17 m 46 sec
Reputation Power: 12
You're right, several files are possible. However, gzip considers several members in an archive to be concatenated data. Do other programmes handle that differently?
Posts: 459
Time spent in forums: 2 Days 8 h 4 m 29 sec
Reputation Power: 10
I've not studied very well which programs does what, but I know that within the header of each member there are (optional) fields to tell the filename. But I don't know which programs (if any/all) sets this filename, and I don't know how cares when reading the file.
As such, it is much wiser to use the tar.gz-format which is publicly known mainly within the unix community, but at a steadily higher degree in Windows as weel (through the use of WinZip, at least). Or to use the PK Zip-file format, which is understood on both platforms.
Sorry for not including references to Mac here, but I haven't used that to any extent, but I have a faint idea that the PK Zip-file format is a little more known than tar.gz. What (I think) I do know is that the Mac format of .sit or .hqx(?) are not that widely supported the other way around. (Although WinZip gets most of what you throw at it... )