#49645 [Opn->Csd]: dio_open parameters are incorrect
| From: | torben@php.net | Date: | Tue, 29 Sep 2009 05:51:53 +0000 |
| Subject: | #49645 [Opn->Csd]: dio_open parameters are incorrect | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-2833@lists.php.net to get a copy of this message | ||
ID: 49645
Updated by: torben@php.net
Reported By: mbarlocker at soleranetworks dot com
-Status: Open
+Status: Closed
Bug Type: Documentation problem
PHP Version: 5.3.0
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation
better.
Previous Comments:
------------------------------------------------------------------------
[2009-09-29 05:51:35] svn@php.net
Automatic comment from SVN on behalf of torben
Revision: http://svn.php.net/viewvc/?view=revision&revision=288931
Log: Several grammatical fixes and some factual corrections.
Corrected the documentation of the mode param (addresses bug #49645).
------------------------------------------------------------------------
[2009-09-23 16:46:14] mbarlocker at soleranetworks dot com
Description:
------------
The arguments for this function are incorrect. You will not notice this
until you try to use dio_open and then dio_write. You will get this
error on the console: 'Bad file descriptor'.
the 'flags' parameter MUST include one of {O_RDONLY, O_WRONLY, O_RDWR}.
It may also include any combination of the flags listed.
the 'mode' parameter is NOT the read/write mode. It is the permissions
of the file. For example 0644 or 0755. Notice that there are not quotes
around these permissions.
This works correctly on Fedora 10 x86_64 php 5.2.9.
Reproduce code:
---------------
<?php
$fd = dio_open('output', O_CREAT | O_TRUNC, O_WRONLY);
dio_write($fd, 'this is the output.');
dio_close($fd);
?>
Expected result:
----------------
write 'this is the output.' to ./output
Actual result:
--------------
PHP Warning: dio_write(): cannot write data to file descriptor 0, Bad
file descriptor in /home/mbarlocker- on line 4
ls -la
---------x 1 mbarlocker mbarlocker 0 2009-09-23 10:46 output
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=49645&edit=1