php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #25475 Direct IO access to raw file descriptor
Submitted: 2003-09-10 15:08 UTC Modified: 2010-11-18 23:36 UTC
Votes:5
Avg. Score:4.8 ± 0.4
Reproduced:5 of 5 (100.0%)
Same Version:1 (20.0%)
Same OS:3 (60.0%)
From: mbostrom at syrah dot us Assigned:
Status: Not a bug Package: *General Issues
PHP Version: Irrelevant OS: Unixes
Private report: No CVE-ID: None
 [2003-09-10 15:08 UTC] mbostrom at syrah dot us
Description:
------------
The Direct IO functions are nice.

However, it is sometimes necessary to access file descriptors by their number.  For instance, a parent process can set up file descriptors 3, 4 and 5 for communication with the a child process (in addition to file descriptors 0, 1 and 2).  It would be nice if there were a way in PHP to get access to to file descriptor 3, so that PHP could interoperate with software that uses "extra" file descriptors.  (In particular, I am writing a mail filter.  The mail server sets up fd 3).

Getting access to the "extra" file descriptors is not possible at present, because the only way to get a file descriptor is to call dio_open on a file.  What if the file descriptor already exists?  There is currently no way to access it.

Perhaps a function such as dio_rawfd (int fdnum) could be added?  fdnum is an integer - the number of the file descriptor you want.  dio_rawfd returns a file descriptor resource for file descriptor number fdnum.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-02-15 20:48 UTC] php at kanarpiet dot com
It would indeed be very nice to be able to use the extra file 
descriptors opened by the parents proc_open() call.

However, you should also be able to use the normal fgets() and 
fputs() functions, not just the Direct IO ones.
 [2008-11-24 13:18 UTC] rodrigo at fabricadeideias dot com
How can this be done with fgets and fputs?
 [2010-11-18 23:36 UTC] jani@php.net
-Status: Open +Status: Bogus -Package: Feature/Change Request +Package: *General Issues
 [2010-11-18 23:36 UTC] jani@php.net
Report requests/bugs on this PECL extension here:
http://pecl.php.net/bugs/search.php?cmd=display&status=Open&package_name[]=dio
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 18:01:31 2024 UTC