Re: exec, system , backtick
| From: | gamin | Date: | Sat, 28 Dec 2002 07:54:25 +0000 |
| Subject: | Re: exec, system , backtick | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-129489@lists.php.net to get a copy of this message | ||
"Maciek Ruckgaber Bielecki" <maciek@geekbunker.hn.org> wrote in message
news:20021227164620.Y34717-100000@geekbunker.hn.org...
> how about :
> #!/usr/local/bin/php -q
>
> <?PHP
> $file = 'no_file';
>
> if(!is_file($file))
> $mess = "no such file";
> else
> $mess = shell_exec("ls $file");
>
> echo $mess."\n";
> ?>
> regards,
> Maciek Ruckaber Bielecki
>
Hi Maciek,
I used rm as an example to illustrate what i want to do, basically i need
to catch an error if it occurs and STOP the script from going ahead and
include the error in a file for later examination. I would be using 'rm,
unzip, tar, rpm' etc commands from inside a PHP script. Micheal Sims' post
has something interesting.
gamin