#49645 [NEW]: dio_open parameters are incorrect

From: Date: Wed, 23 Sep 2009 16:46:14 +0000
Subject: #49645 [NEW]: dio_open parameters are incorrect
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-2806@lists.php.net to get a copy of this message
From:             mbarlocker at soleranetworks dot com
Operating system: 
PHP version:      5.3.0
PHP Bug Type:     Documentation problem
Bug description:  dio_open parameters are incorrect

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 bug report at http://bugs.php.net/?id=49645&edit=1
-- 
Try a snapshot (PHP 5.2):            http://bugs.php.net/fix.php?id=49645&r=trysnapshot52
Try a snapshot (PHP 5.3):            http://bugs.php.net/fix.php?id=49645&r=trysnapshot53
Try a snapshot (PHP 6.0):            http://bugs.php.net/fix.php?id=49645&r=trysnapshot60
Fixed in SVN:                        http://bugs.php.net/fix.php?id=49645&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=49645&r=needdocs
Fixed in release:                    http://bugs.php.net/fix.php?id=49645&r=alreadyfixed
Need backtrace:                      http://bugs.php.net/fix.php?id=49645&r=needtrace
Need Reproduce Script:               http://bugs.php.net/fix.php?id=49645&r=needscript
Try newer version:                   http://bugs.php.net/fix.php?id=49645&r=oldversion
Not developer issue:                 http://bugs.php.net/fix.php?id=49645&r=support
Expected behavior:                   http://bugs.php.net/fix.php?id=49645&r=notwrong
Not enough info:                     http://bugs.php.net/fix.php?id=49645&r=notenoughinfo
Submitted twice:                     http://bugs.php.net/fix.php?id=49645&r=submittedtwice
register_globals:                    http://bugs.php.net/fix.php?id=49645&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=49645&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=49645&r=dst
IIS Stability:                       http://bugs.php.net/fix.php?id=49645&r=isapi
Install GNU Sed:                     http://bugs.php.net/fix.php?id=49645&r=gnused
Floating point limitations:          http://bugs.php.net/fix.php?id=49645&r=float
No Zend Extensions:                  http://bugs.php.net/fix.php?id=49645&r=nozend
MySQL Configuration Error:           http://bugs.php.net/fix.php?id=49645&r=mysqlcfg



Thread (2 messages)

« previous php.doc.bugs (#2806) next »