Re: howto get .tar.gz content's filenames
| From: | Cesar D. Rodas | Date: | Tue, 04 Dec 2007 21:22:46 +0000 |
| Subject: | Re: howto get .tar.gz content's filenames | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-265457@lists.php.net to get a copy of this message | ||
Call exec is not good, because you are executing other program, instead of
that you should use some PHP program, take a look here
http://www.phpclasses.org/search.html?words=tar&x=0&y=0&go_search=1
On 04/12/2007, Daniel Brown < parasane@gmail.com> wrote:
>
> On Dec 3, 2007 10:05 PM, Shelley Shyan < Shelley.Shyan@morodo.com.cn>
> wrote:
> > Hi all,
> >
> > It may not be a php question, but I want to get the filename lists that
> a .tar.gz file contains and give it to an array.
> > How can I manage that?
> >
> > Thank you very much for your consideration.
> >
> > Regards,
> > Shelley
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
> If you're on Linux/BSD/Unix/MacOS or Cygwin on Windows, this should
> work:
>
> <?php
> $tar_gz_file = " filename.tar.gz"; // Replace this with the actual
> filename.
> exec('tar -ztf '.$tar_gz_file,$ret);
> print_r($ret);
> ?>
>
>
> --
> Daniel P. Brown
> [office] (570-) 587-7080 Ext. 272
> [mobile] (570-) 766-8107
>
> If at first you don't succeed, stick to what you know best so that you
> can make enough money to pay someone else to do it for you.
>
> --
> PHP General Mailing List (http://www.php.net/ )
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
Best Regards
Cesar D. Rodas
www.cesarodas.com
www.thyphp.com
www.phpajax.org
Phone: +595-961-974165
--
Best Regards
Cesar D. Rodas
http://www.cesarodas.com
http://www.thyphp.com
http://www.phpajax.org
Phone: +595-961-974165