Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

php, fun!

Name: Anonymous 2009-05-16 17:44

Hello there. I'm using popen to run some programs that output a text blob after several seconds. I'm using fgets to read from the processes stdout, but when I do that fgets just hangs until the process finally does output the text. What I want is to check to the stdout, and if nothing was output then to move on.

tl;dr I want to check if the process is done, if it isn't then I want to have the program do something else and come back to it later. Help.

Name: Anonymous 2009-05-16 17:51

Use just kidding, you're using PHP, there's no hope for you, problem solved.

Name: sage 2009-05-16 17:51

sage

Name: Anonymous 2009-05-16 18:07

Wolfram|Alpha isn't sure what to do with your input.

Name: Anonymous 2009-05-16 18:32

Well pretend I'm using perl, now can you answer the question?
>>2

Name: Anonymous 2009-05-16 18:40

>>5
The fact that you already mentioned you were using PHP precludes you from receiving an answer.
Begone, or I will sage thy thread across!

Name: Anonymous 2009-05-16 18:41

>>5
Use just kidding, now you have an additional problem, problem solved.

Name: Anonymous 2009-05-16 18:44

Use VIOLENT RAPE, problem solved.

Name: Anonymous 2009-05-16 18:55

How do I blocked IO ヽ(´ー`)ノ

Name: Anonymous 2009-05-16 18:57

You need more forks.

Name: Anonymous 2009-05-16 19:03

>>10
Don't HELP him!!!

Name: Anonymous 2009-05-16 19:53

Name: Anonymous 2009-05-16 20:37

  ∧_∧   ∧_∧   ∧_∧   ∧_∧     ∧_∧
 ( ・∀・)   ( `ー´)  ( ´∀`)  ( ゚ ∀゚ )    ( ^∀^)
 (    つ┳∪━━∪━∪━━∪━∪━∪━┳⊂     つ
 | | | ,┃This thread has peacefully ended.┃ | | |
 (__)_) ┻━━━━━━━━━━━━━━┻ (__)_)     Thank you.

Name: Anonymous 2009-05-16 20:44


    /\___/\
   /       \
  |  #    # |
  \     @   |
   \   _|_ /
   /       \______
  / _______ ___   \
  |_____   \   \__/
   |    \__/
   |       |

Name: Anonymous 2009-05-16 20:44


   |       |
   |       |
   |       |
   |       |
   |       |
   |       |
   |       |
   |       |
   |       |

Name: Anonymous 2009-05-16 20:44


   |       |
   |       |
   |       |
   |       |
   |       |
   |       |
   |       |
   |       |
   |       |

Name: Anonymous 2009-05-16 20:45


   |       |
   |       |
   |       |
   |       |
   /        \
  /   ____   \
  |  /    \  |   longcat is loong!
  | |      | |
 /  |      |  \
 \__/      \__/

Name: Anonymous 2009-05-16 20:51

>>14
>>15
>>16
>>17
XD epic combo

Name: Anonymous 2009-05-16 20:53

archive this shit!!!!!!!
TOASTING IN EPIK BREAD

Name: Anonymous 2009-05-16 22:06

>>14-19
You've taken that troll too far.

Name: Anonymous 2009-05-16 22:26

>>18
Please optimize your quoting!
>>14-17

Name: Anonymous 2009-05-16 22:30

>>10
I can't fork because I have an active db connection that needs to be reopen in all the children.
>>12
I don't think this works with popen..

I found that proc_get_status can be used with proc_open to find if the process finished, so yay me.

Name: Anonymous 2009-05-16 23:27

I can't fork because I have an active db connection that needs to be reopen in all the children.
lrn2fork

Name: Anonymous 2009-05-17 1:35

Why did you include fun in the title? Php does not condone any fun

Name: Anonymous 2009-05-17 1:50

php is all about strictly disciplined, efficient code.
ammirite?

Name: Anonymous 2009-05-17 4:49

Name: Anonymous 2009-05-17 6:41

Update:
Oh! How I forgot this one: (thanks to Imran)

stackoverflow
For all kind of programming Q and A.

Name: Anonymous 2009-05-17 7:48

>>23
fork
Now you have two problems.

Name: Anonymous 2009-05-17 8:08

>>28
s/lems/loms/g

Name: Anonymous 2009-05-17 10:45

>>25
PHP is all about running proxy servers on free PHP webspace and using said proxies to post illegal material on 4chan.

Name: Anonymous 2010-11-26 11:10

Don't change these.
Name: Email:
Entire Thread Thread List