Page 1 of 1
extract GZ?
Posted: Fri Feb 07, 2003 10:39 am
by CONFIQ
I need examle how to extract GZ file...
'Till now i've make this
Code: Select all
<?php $file = 'gz.gz';
$test = gzopen("$file",'r');
$data = gzread($test,1000);
print_r($data)
?>
It will echo data as i want to,but what if in *.gz is more that 2 files? how do i extract just one?
Posted: Fri Feb 07, 2003 11:05 am
by BigE
Well, the PHP functions are just for gzip, not tar. When you have files in an archive like that, they are most likely tared also. gzip is only compression, it doesn't handle anything with the taring process. I suggest you take a look nin Pear, there is a TAR class in there that could be helpful.
Posted: Fri Feb 07, 2003 1:16 pm
by daven
If the nin Pear class cannot do what you need, it is always possible to run a system command to handle *.tar/*.gz files.
Posted: Sun Feb 09, 2003 3:40 pm
by CONFIQ
Yeah but i don't need TAR in this case...
I've just wander how to extract GZ if there is more than 2 files or how to list them.But,as i can understand,GZ compression dosen't support more than 2 files.Right?
Posted: Sun Feb 09, 2003 5:53 pm
by hob_goblin
CONFIQ wrote:Yeah but i don't need TAR in this case...
I've just wander how to extract GZ if there is more than 2 files or how to list them.But,as i can understand,GZ compression dosen't support more than 2 files.Right?
That's what BigE tried to say. GZ doesn't combine files like that.
Posted: Sun Feb 09, 2003 6:51 pm
by CONFIQ
groovy

Thank you guys