php, fun!
1
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.
2
Name:
Anonymous
2009-05-16 17:51
Use just kidding, you're using PHP, there's no hope for you , problem solved.
3
Name:
sage
2009-05-16 17:51
sage
4
Name:
Anonymous
2009-05-16 18:07
Wolfram|Alpha isn't sure what to do with your input.
5
Name:
Anonymous
2009-05-16 18:32
Well pretend I'm using perl, now can you answer the question?
>>2
6
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!
7
Name:
Anonymous
2009-05-16 18:41
>>5
Use
just kidding, now you have an additional problem , problem solved.
8
Name:
Anonymous
2009-05-16 18:44
Use VIOLENT RAPE , problem solved.
9
Name:
Anonymous
2009-05-16 18:55
How do I blocked IO ヽ(´ー`)ノ
10
Name:
Anonymous
2009-05-16 18:57
You need more forks.
11
Name:
Anonymous
2009-05-16 19:03
12
Name:
Anonymous
2009-05-16 19:53
13
Name:
Anonymous
2009-05-16 20:37
∧_∧ ∧_∧ ∧_∧ ∧_∧ ∧_∧
( ・∀・) ( `ー´) ( ´∀`) ( ゚ ∀゚ ) ( ^∀^)
( つ┳∪━━∪━∪━━∪━∪━∪━┳⊂ つ
| | | ,┃This thread has peacefully ended.┃ | | |
(__)_) ┻━━━━━━━━━━━━━━┻ (__)_) Thank you.
14
Name:
Anonymous
2009-05-16 20:44
/\___/\
/ \
| # # |
\ @ |
\ _|_ /
/ \______
/ _______ ___ \
|_____ \ \__/
| \__/
| |
15
Name:
Anonymous
2009-05-16 20:44
| |
| |
| |
| |
| |
| |
| |
| |
| |
16
Name:
Anonymous
2009-05-16 20:44
| |
| |
| |
| |
| |
| |
| |
| |
| |
17
Name:
Anonymous
2009-05-16 20:45
| |
| |
| |
| |
/ \
/ ____ \
| / \ | longcat is loong!
| | | |
/ | | \
\__/ \__/
18
Name:
Anonymous
2009-05-16 20:51
>>14
>>15
>>16
>>17
XD epic combo
19
Name:
Anonymous
2009-05-16 20:53
archive this shit!!!!!!!
TOASTING IN EPIK BREAD
20
Name:
Anonymous
2009-05-16 22:06
>>14-19
You've taken that troll too far.
21
Name:
Anonymous
2009-05-16 22:26
>>18
Please optimize your quoting!
>>14-17
22
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.
23
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
24
Name:
Anonymous
2009-05-17 1:35
Why did you include fun in the title? Php does not condone any fun
25
Name:
Anonymous
2009-05-17 1:50
php is all about strictly disciplined, efficient code.
ammirite?
26
Name:
Anonymous
2009-05-17 4:49
27
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.
28
Name:
Anonymous
2009-05-17 7:48
>>23
fork
Now you have two problems.
29
Name:
Anonymous
2009-05-17 8:08
30
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.
31
Name:
Anonymous
2010-11-26 11:10