note 49164 added to function.exec
| From: | layter at osu1 dot php dot net | Date: | Tue, 18 Jan 2005 20:25:09 +0000 |
| Subject: | note 49164 added to function.exec | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-83575@lists.php.net to get a copy of this message | ||
a note to exec:
First I assume that you are using unix/linux and not windows. I believe that if you redirect
standard output to /dev/null after you have redirected stderr to stdout, that you will end up
discarding stdout and seeing only stderr. This would look like this:
ps 2>&1 1>/dev/null
if you need to see both, but you need to keep them seperate, then you need proc_open() which allows
you to feed standard input as well as read standard output and standard error.
If you need to spool the process off into the background then you can create some FIFO files and
redirect the input and output to those files. Then you can open the fifo files and have access to
each data stream independantly. (expect a squabble with this method because fifo's tend to
block and it's real easy to get yourself into a deadlock condition - though once you get it
working, it should be quite dependable)
----
Manual Page -- http://www.php.net/manual/en/function.exec.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+49164
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+49164&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+49164&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+49164&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+49164&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+49164&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+49164&report=yes
Search -- http://master.php.net/manage/user-notes.php