|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2001-03-08 06:02 UTC] achim at lkcc dot org
Open an existing text file (insert some crap before) like:
$output = fopen("test.txt", "a"); #we want append something
Here is the problem:
$position = ftell($output); #returns always 0 and not the real fileposition!!!
fputs($output, "test"); #but this works without any problems (it has the real fileposition, but ftell gets the false one)
I found this bug only on windows systems, not on linux.
Achim
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 21:00:01 2025 UTC |
following script works okay for me (win2k) so closing. <?php $output = fopen("test.txt", "a+"); echo "bytes written: ", fputs($output, "test"), "\n<br>file offset: ". ftell($output); fclose($output); ?>