ID: 26158
Updated by: [EMAIL PROTECTED]
Reported By: mattias at sudac dot org
-Status: Open
+Status: Feedback
Bug Type: Feature/Change Request
Operating System: Linux
PHP Version: 4.3.3
New Comment:
Why does fopen("/dev/fd/x", "r") fail ?
Previous Comments:
------------------------------------------------------------------------
[2003-11-06 20:26:32] mattias at sudac dot org
Description:
------------
On some operating systems (BSD?) it is possible to open a arbitrary
file descriptor with fopen like this:
fopen("/dev/fd/<fd>", "r");
But on at least Linux this fails. So here is patch that makes it
possible to open fd:s by useing fopen("php://<fd>", "r").
in ext/standard/php_fopen_wrapper.c:php_stream_url_wrap_php add two
lines:
} else if (!strcasecmp(path, "stderr")) {
fd = STDERR_FILENO;
+} else
+ fd = atoi(path);
Maybe some checks are needed.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=26158&edit=1