php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63895 ftell() returns wrong pointer position
Submitted: 2013-01-03 22:35 UTC Modified: 2013-01-03 23:27 UTC
From: bugzilla77 at gmail dot com Assigned:
Status: Not a bug Package: Streams related
PHP Version: 5.4.10 OS:
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: bugzilla77 at gmail dot com
New email:
PHP Version: OS:

 

 [2013-01-03 22:35 UTC] bugzilla77 at gmail dot com
Description:
------------
ftell() returns wrong pointer position

Test script:
---------------

<?php
 $f=fopen(__FILE__,'a'); // spec: 'a' place the file pointer at the end of the file
 print(ftell($f)); // spec: Returns the current position of the file read/write pointer
 fclose($f);
?>



Expected result:
----------------

__FILE__ size



Actual result:
--------------

zero



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-01-03 23:27 UTC] rasmus@php.net
-Status: Open +Status: Not a bug
 [2013-01-03 23:27 UTC] rasmus@php.net
This is quite clearly documented in the ftell() docs:

"ftell() gives undefined results for append-only streams (opened with "a" flag)."
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 15 10:01:30 2024 UTC