RE: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread Darren Gamble

Good day,

flush() will just empty the contents of the output buffer when it's called.
You should do this after you output the command, yes, or the user will have
to wait until the rest of the page is loaded.  But this won't let you see
the output as it is generated by the system() function.

You may want to try popen instead.  This gives you a pipe to the process, so
you _should_ be able to read in lines of the output and display them as they
appear, whilst using flush()  (although I have never tried this myself so I
can not vouch for it).


Darren Gamble
Planner, Regional Services
Shaw Cablesystems GP
630 - 3rd Avenue SW
Calgary, Alberta, Canada
T2P 4L4
(403) 781-4948


-Original Message-
From: faeton [mailto:[EMAIL PROTECTED]]
Sent: Friday, November 30, 2001 2:21 PM
To: Julio Nobrega Trabalhando
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Re: system(), flush() and so on...


Hello Julio,

Hm... I don't even know what to specify :)
The exact problem is using system("traceroute host.com"), but it
should've returned its results line by line, instead of executing the
whole command and then outputting its result.

That is done by flush(), which is executed by system() foo itself, but
i couldn't understand why i have needed result on some servers and on
others - vice versa.

JNT>   Hi, please be more specific. Including what error you are getting,
what is
JNT> the tools being used, and their versions.
JNT>   Here's a quick help for producing better questions, wich will in turn
make
JNT> us answer faster and with more quality:
JNT> http://www.tuxedo.org/~esr/faqs/smart-questions.html
JNT>   PS: btw, I am far away from being a 'hacker', don't get me wrong
whole
JNT> list people :-)


Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Re: system(), flush() and so on...

2001-11-30 Thread faeton

Hello Julio,

Hm... I don't even know what to specify :)
The exact problem is using system("traceroute host.com"), but it
should've returned its results line by line, instead of executing the
whole command and then outputting its result.

That is done by flush(), which is executed by system() foo itself, but
i couldn't understand why i have needed result on some servers and on
others - vice versa.

JNT>   Hi, please be more specific. Including what error you are getting, what is
JNT> the tools being used, and their versions.
JNT>   Here's a quick help for producing better questions, wich will in turn make
JNT> us answer faster and with more quality:
JNT> http://www.tuxedo.org/~esr/faqs/smart-questions.html
JNT>   PS: btw, I am far away from being a 'hacker', don't get me wrong whole
JNT> list people :-)


Ivan 'Faeton aka xetrix' Danishevsky
ICQ(240266) [EMAIL PROTECTED] www.xemichat.com


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]