|  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
 [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: Sat Mar 25 14:04:13 2023 UTC