|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-12-23 07:35 UTC] ullix at urkam dot de
Description: ------------ downloaded dio package from cvs according to this page: http://de3.php.net/manual/en/install.pecl.downloads.php and compiled shared PECL extensions with phpize according to this page: http://de3.php.net/manual/en/install.pecl.phpize.php It completed with no errors. resulting dio.so 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: --------------- <?php # create a file using "f" functions $fhandle = fopen('test.txt','w+'); fwrite($fhandle,'0123456789_0123456789_0123456789_0123456789'); fclose($fhandle); # now use dio functions dl('dio.so'); $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 ); dio_close($dhandle); 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 PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 14:00:01 2025 UTC |
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.