php.net |  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.

Achim

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-03-13 06:34 UTC] dbeu@php.net
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);
?>
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC