Connecting Tech Pros Worldwide Help | Site Map

exec() and &

 
LinkBack Thread Tools Search this Thread
  #1  
Old March 15th, 2008, 01:55 AM
Bryan Andrews
Guest
 
Posts: n/a
Default exec() and &

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, 02:35 AM
Steve
Guest
 
Posts: n/a
Default 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, 07:45 PM
Bryan Andrews
Guest
 
Posts: n/a
Default 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, 05:45 PM
good@respnse.sic.com
Guest
 
Posts: n/a
Default 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.
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,989 network members.