Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

i'm trying to do compression of a directory containing about 700 wave files on a php script.
So far i have tried using php to create .zip, but seems this method takes a bit too long.~2min+

I then proceeded to try (~1min):
exec( "tar cf $archive $directory");
exec( "gzip $archive");


I kind of assumed that using system commands should be faster than php library?

Anyway, what is the fastest compression method for me to use on my webhost service?

And is it possible to create an auto-extractor with .tar.gz files?
If i could create .zip files fast enough, I would not need an auto extractor as .zip is widely supported on windows and mac os. Otherwise .tar.gz poses an extra step for users if they had to install another application like 7-zip to uncompress my .tar.gz file.

My webhost runs linux, Apache.

Many Thanks!
Brian
Posted
Updated 30-Mar-11 17:56pm
v2

1 solution

I would suggest you to use the ZIP library provided by the PHP as that is more efficient and can be run on any platform.



http://php.net/manual/en/book.zip.php

I would suggest you take a look at the link.

BR//
Harsha
 
Share this answer
 
v2
Comments
funniezatee 31-Mar-11 3:04am    
Thats the php zip method i have tried. But this takes too long and times out at 300seconds. For .tar.gz format, its fast, just that there does not seem to be a self extractor out there. Maybe i will need to bundle my download with a uncompressing utility.
ZeeroC00l 31-Mar-11 7:19am    
Yea, there seems to be no self extract utility for tar.gz file in Windows. But if you are targetting just the unix users then you can always create a custom extractor for the tar.gz file.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900