note 49164 deleted from function.exec by tularis
| From: | tularis@php.net | Date: | Tue, 18 Jan 2005 22:43:22 +0000 |
| Subject: | note 49164 deleted from function.exec by tularis | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-83586@lists.php.net to get a copy of this message | ||
Note Submitter: layter
Reason: useless
----
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)