|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #57976 dio_write does not work
Submitted: 2007-12-23 07:35 UTC Modified: 2016-12-25 04:22 UTC
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: ullix at urkam dot de Assigned:
Status: No Feedback Package: dio (PECL)
PHP Version: 5.2.1 OS: kubuntu 7.04
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: ullix at urkam dot de
New email:
PHP Version: OS:


 [2007-12-23 07:35 UTC] ullix at urkam dot de
downloaded dio package from cvs according to this page:
and compiled shared PECL extensions with phpize according to this page:

It completed with no errors.

resulting seems to function for all dio commands except dio_write, which always produces error and results in no write. Strange reference to a file descriptor which bears no relationship to the handle from open command

Reproduce code:
# create a file using "f" functions
$fhandle = fopen('test.txt','w+');

# now use dio functions
$dhandle = dio_open('test.txt', O_CREAT | O_NONBLOCK,  O_RDWR);
echo "dio_handle:$dhandle, result from dio_read: ".dio_read($dhandle, 20);
$result = dio_write($dhandle, 'aaaaa_bbbbb_ccccc_ddddd_',12 );

Actual result:
actual output:

dio_handle:Resource id #4, result from dio_read: 0123456789_012345678
Warning: dio_write() [function.dio-write]: cannot write data to file descriptor 10, Bad file descriptor in /home/ullix/dio_bug.php on line 12


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-01-25 18:54 UTC]
I have reproduced the code in 5.2.5.
 [2008-09-18 01:15 UTC] chris at heathens dot co dot nz
Ummm, no, you are calling it with incorrect parameters.  It should be:

$dhandle = dio_open('test.txt', O_CREAT | O_NONBLOCK | O_RDWR, 0644);

Mode refers to the permission mode when creating the file, see open(2) man page.
 [2016-12-13 07:04 UTC]
-Status: Open +Status: Feedback
 [2016-12-13 07:04 UTC]
Does this still exists with latest 0.0.8 ?
 [2016-12-25 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Aug 10 16:03:35 2022 UTC