From: kraghuba at in dot ibm dot com Operating system: linux, windows PHP version: Irrelevant PHP Bug Type: Documentation problem Bug description: fopen() documentation for append mode needs more clarity
Description: ------------ The current documentation of fopen for append mode doesn't state clearly where the file pointer is set initally. The doc says : "In a mode : Open for writing only; place the file pointer at the end of the file. If the file does not exist, attempt to create it.". But in reality the file pointer is set to 0, the file position is moved to end of file before any write operation. Please modify the document to make this clear. I also noticed that in response to following defect this was explained : "Bug #15528: ftell does not work consistently" Reproduce code: --------------- <?php $fp = fopen(__FILE__, "a"); var_dump($fp); var_dump( ftell($fp) ); // ftell should return the size of the file fclose($fp); ?> Expected result: ---------------- C:\workdir\test>php fopen.php resource(5) of type (stream) int(0) Actual result: -------------- C:\workdir\test>php fopen.php resource(5) of type (stream) int(0) -- Edit bug report at http://bugs.php.net/?id=41763&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41763&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41763&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41763&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41763&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41763&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41763&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=41763&r=needscript Try newer version: http://bugs.php.net/fix.php?id=41763&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41763&r=support Expected behavior: http://bugs.php.net/fix.php?id=41763&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41763&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41763&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41763&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41763&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41763&r=dst IIS Stability: http://bugs.php.net/fix.php?id=41763&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41763&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41763&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41763&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=41763&r=mysqlcfg
