Connecting Tech Pros Worldwide Help | Site Map

exec() and &

  #1  
Old March 15th, 2008, 02:55 AM
Bryan Andrews
Guest
 
Posts: n/a
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?
  #2  
Old March 15th, 2008, 03:35 AM
Steve
Guest
 
Posts: n/a

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.
  #3  
Old March 15th, 2008, 08:45 PM
Bryan Andrews
Guest
 
Posts: n/a

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!
  #4  
Old March 17th, 2008, 06:45 PM
good@respnse.sic.com
Guest
 
Posts: n/a

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Launching a program with exec & pstools/psexec.exe vol30w60 answers 4 April 10th, 2007 09:55 PM
Show & hide multiple div tags with one click Eero Tuomenoksa answers 2 May 28th, 2006 06:15 PM
Mailer code sample available? Also - loop & delay question D. Shane Fowlkes answers 4 November 19th, 2005 02:06 PM
Exec & IIS problem shahid.juma@gmail.com answers 3 October 13th, 2005 02:35 PM
How is call exec("/usr/usr/bin -C $U2 &"); Mike answers 3 July 17th, 2005 01:42 AM