Re: Re: How to fire off a unix command WITHOUT waiting for it to return (I want to use &)
| From: | Curt Zirzow | Date: | Sat, 11 Oct 2003 03:48:54 +0000 |
| Subject: | Re: Re: How to fire off a unix command WITHOUT waiting for it to return (I want to use &) | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-165828@lists.php.net to get a copy of this message | ||
* Thus wrote Daevid Vincent (daevid@daevid.com):
> Yeah, that is the 'hack' solution I came up with too. LOL.
>
> I guess I was hoping for something more elegant...
>
> Is there a reason that PHP doesn't handle the & properly? I mean, it seems
> as though you'd have to go out of your way to force it NOT to spawn the task
> in the background. If PHP was just executing the command in a shell, it
> seems that the OS would handle the & for you...
true, but php exec's your program through a pipe. So because a the
pipe opens bidirectional handles for input and output, I believe the system
can't let the program go into the background because the output
handle cant be released.
Another option, and may be cleaner, is to enable and option to your
C program to daemonize itself.
HTH,
Curt
--
"My PHP key is worn out"
PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/