Connecting Tech Pros Worldwide Forums | Help | Site Map

exec() and &

Bryan Andrews
Guest
 
Posts: n/a
#1: Mar 15 '08
At the shell you can always type "rm -rf /tmp/* &" and let the delete
command run in the background. Is there a way to do this from a php
shell script?

I've tried `rm -rf /tmp/* &` ... but with the backticks it still
waits for the command to finish before moving on to the next. I've
also tried exec() with no luck. Anyone know any tricks?

Steve
Guest
 
Posts: n/a
#2: Mar 15 '08

re: exec() and &


On Mar 14, 9:54 pm, Bryan Andrews <bryanandr...@gmail.comwrote:
Quote:
At the shell you can always type "rm -rf /tmp/* &" and let the delete
command run in the background. Is there a way to do this from a php
shell script?
>
I've tried `rm -rf /tmp/* &` ... but with the backticks it still
waits for the command to finish before moving on to the next. I've
also tried exec() with no luck. Anyone know any tricks?
http://us.php.net/manual/en/function.pcntl-fork.php

It's not really threading, but you can escape the parent process while
the child is running.
Bryan Andrews
Guest
 
Posts: n/a
#3: Mar 15 '08

re: exec() and &


On Mar 14, 7:33 pm, Steve <steve.h...@gmail.comwrote:
Quote:
On Mar 14, 9:54 pm, Bryan Andrews <bryanandr...@gmail.comwrote:
>
Quote:
At the shell you can always type "rm -rf /tmp/* &" and let the delete
command run in the background. Is there a way to do this from a php
shell script?
>
Quote:
I've tried `rm -rf /tmp/* &` ... but with the backticks it still
waits for the command to finish before moving on to the next. I've
also tried exec() with no luck. Anyone know any tricks?
>
http://us.php.net/manual/en/function.pcntl-fork.php
>
It's not really threading, but you can escape the parent process while
the child is running.
That worked great, thanks!
good@respnse.sic.com
Guest
 
Posts: n/a
#4: Mar 17 '08

re: exec() and &


In article <1b3a9e06-a84d-4a95-a22a-
d8cec47b4c2b@e25g2000prg.googlegroups.com>, bryanandrews@gmail.com
says...
Quote:
Quote:
http://us.php.net/manual/en/function.pcntl-fork.php

It's not really threading, but you can escape the parent process while
the child is running.
>
That worked great, thanks!
>
Seconded - very interesting reading - thank you.
Closed Thread