开发者

-C option is ignored when calling tar via PHP

开发者 https://www.devze.com 2023-01-15 18:34 出处:网络
If I run my PHP file from the shell, then the tar command extracts to the directory 开发者_如何学GoI am in, rather than the one I specified using -C

If I run my PHP file from the shell, then the tar command extracts to the directory 开发者_如何学GoI am in, rather than the one I specified using -C

My command is

passthru("tar xvf $file $tarfile/application $tarfile/application_detail $tarfile/application_device_type $tarfile/genre_application -C /var/www/vhosts/httpdocs/fred"); 

How can I have it extract the specific files to the specified destination directory?

The filename is filename.tgz


At the moment you have:

tar xvf tarfile paths... -C target

Change the order of the arguments to:

tar xvf tarfile -C target paths...
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号