php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #14231 c-function select() please
Submitted: 2001-11-26 09:00 UTC Modified: 2005-05-02 09:40 UTC
From: php at korelstar dot de Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.0.6 OS: Linux 2.4
Private report: No CVE-ID: None
 [2001-11-26 09:00 UTC] php at korelstar dot de
I'm not familiar with C, but I heard that the function "select" will help me with this problem:

I have a fifo-pipe and want to read from it. But the scripts doesn't do anything until I write something to the pipe. But I want to open the pipe with PHP and on the next step, I want to write something to it.
The Problem ist, that I have to know, if there is data on the pipe or not. feof does not help.

On the other side, the PHP-function popen should be extended for read AND write on Linux. I heard, other plattforms can do it already.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-26 09:14 UTC] derick@php.net
popen is unidirectional on Linux, PHP can't fix that:

(from "man popen"):
       The  popen()  function opens a process by creating a pipe,
       forking, and invoking the shell.  Since a pipe is by defi?
       nition  unidirectional, the type argument may specify only
       reading or writing, not both; the resulting stream is cor?
       respondingly read-only or write-only.

And the other problem can be fixed by using non-blocking IO, which PHP does not support now AFAIK.

Derick
 [2005-05-02 09:40 UTC] andrey@php.net
proc_open & stream_select
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Sep 19 21:01:26 2024 UTC