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
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
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.

Achim

Patches

Add a Patch

Pull Requests

Add a Pull Request

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 Apr 27 00:01:30 2024 UTC