|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9617 fileposition error
Submitted: 2001-03-08 06:02 UTC Modified: 2001-03-13 06:34 UTC
From: achim at lkcc dot org Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.4pl1 OS: Windows
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: achim at lkcc dot org
New email:
PHP Version: OS:


 [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.



Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-13 06:34 UTC]
following script works okay for me (win2k) so closing.

$output = fopen("test.txt", "a+");
echo "bytes written: ", fputs($output, "test"), "\n<br>file offset: ". ftell($output);
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Tue Mar 28 17:03:47 2023 UTC