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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
25 + 28 = ?
Subscribe to this entry?

 
 [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: Thu Apr 25 10:01:29 2024 UTC