How to keep directory structure in gzip
View Single Post
07-23-2010, 02:59 AM
is cute and cuddly
Join Date: Mar 2008
Location: Vegas, Baby
Gzip compresses (and can only compress) a single file. To create a package of files maintaining structure, you need to first create a tarball, then compress that. This is why you see the file extensions .tar.gz and .tgz for archived packages (gzipped tarball). The only things that are compressed directly by gzip are usually long text files, such as log files, etc.
Depending on what you are attempting to do, you may be better off writing a bash script to create your compressed archive. PHP has the exec() function to run command line operations, but using such methods is only recommended if you are well versed in the security concerns it raises.
View Public Profile
Send a private message to delayedinsanity
Visit delayedinsanity's homepage!
Find More Posts by delayedinsanity