note 82342 added to function.pclose
| From: | Mike at osu1 dot php dot net | Date: | Mon, 07 Apr 2008 06:55:51 +0000 |
| Subject: | note 82342 added to function.pclose | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137992@lists.php.net to get a copy of this message | ||
The termination status, as pointed out in another note, is not the same as the exit status from the
process. However, something like "pclose($fp)/256" is not the correct way to extract the
exit status, since this uses system- and version-specific knowledge of where in the termination
status the exit status is stored. (Also, the process may not even have exited normally, so it may
not have an exit status at all.)
Instead, the functions pcntl_wifexited() and pcntl_wexitstatus() should be used. They are wrappers
for the C macros WIFEXITED() and WEXITSTATUS() that are designed for determining whether the process
had an exit status and what that status was, respectively.
----
Server IP: 208.69.120.35
Probable Submitter: 76.170.71.103
----
Manual Page -- http://www.php.net/manual/en/function.pclose.php
Edit -- https://master.php.net/note/edit/82342
Del: integrated -- https://master.php.net/note/delete/82342/integrated
Del: useless -- https://master.php.net/note/delete/82342/useless
Del: bad code -- https://master.php.net/note/delete/82342/bad+code
Del: spam -- https://master.php.net/note/delete/82342/spam
Del: non-english -- https://master.php.net/note/delete/82342/non-english
Del: in docs -- https://master.php.net/note/delete/82342/in+docs
Del: other reasons-- https://master.php.net/note/delete/82342
Reject -- https://master.php.net/note/reject/82342
Search -- https://master.php.net/manage/user-notes.php