# I make a patch, how I report?

- Thread: https://externals.io/message/28872
- Original archive: https://news-web.php.net/php.internals/28872
- Started by Fernando chucre on 2007-04-16T21:24:05+00:00
- Messages: 3
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #28872 — Fernando chucre — 2007-04-16T21:24:05+00:00

URL: https://externals.io/message/28872#28872

Hello all,

I build a patch for wrapper php fopen. In this patch I create a way for
the script access the filedescriptos opened by process. Ex:

php file.php 3<file_in.txt 7>file_out.txt

In this case the script can't read the filedescriptor 3 and 7. Not
have way for read or write in filedescriptor opends by precess.

I make a way for read or write it. I modify the wrapper 'php' for fopen
function. (http://br.php.net/manual/en/wrappers.php.php) A create the
'php:/fd/N' which N is the filedescriptor number.

how to access fd 7 to write?

ex:

<?
$fd = fopen("php://fd/7",'w');
fwrite($fd,"test of write\n");
fclose($fd);
?>

-- 
Fernando Chure
PSL/CE

---

## #28880 — Tijnema ! — 2007-04-17T11:19:46+00:00

URL: https://externals.io/message/28872#28880

> Hello all,
>
> I build a patch for wrapper php fopen. In this patch I create a way for
> the script access the filedescriptos opened by process. Ex:
>
> php file.php 3<file_in.txt 7>file_out.txt
>
> In this case the script can't read the filedescriptor 3 and 7. Not
> have way for read or write in filedescriptor opends by precess.
>
> I make a way for read or write it. I modify the wrapper 'php' for fopen
> function. (http://br.php.net/manual/en/wrappers.php.php) A create the
> 'php:/fd/N' which N is the filedescriptor number.
>
> how to access fd 7 to write?
>
> ex:
>
> <?
> $fd = fopen("php://fd/7",'w');
> fwrite($fd,"test of write\n");
> fclose($fd);
> ?>
>
> --
> Fernando Chure
> PSL/CE


Where's the patch?


Tijnema

---

## #28881 — Christian Schneider — 2007-04-17T11:56:52+00:00

URL: https://externals.io/message/28872#28881 · In reply to: #28872

Fernando chucre wrote:
> I build a patch for wrapper php fopen. In this patch I create a way for
> the script access the filedescriptos opened by process. Ex:

I assume this is non-portable anyway so you could also simply use
something like "/dev/fd/7" instead of "php://fd/7" if you're on Linux or
something similar.

You could also use
http://php.net/manual/function.stream-wrapper-register.php if you want
to hide the implementation from your application.

I don't think the core should be bothered with handling this rare case.

Regards,
- Chris
