|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #61230 stream_seek() is receiving SEEK_CUR on mode 'a' or 'a+'.
Submitted: 2012-03-01 23:48 UTC Modified: 2012-03-03 20:10 UTC
From: frame at dynamiccreated dot de Assigned:
Status: Not a bug Package: Streams related
PHP Version: 5.3.10 OS: Windows
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:
Solve the problem:
3 + 18 = ?
Subscribe to this entry?

 [2012-03-01 23:48 UTC] frame at dynamiccreated dot de
fopen() gives a wrong constant to stream_seek when opening the stream in append mode.

Test script:
SEEK_CUR (1) will be given. This is wrong since mode 'a' should set the pointer to the end of the file, so SEEK_END (2) would be right.

#0  FileWrapper->stream_seek(0, 1)
#1  fopen(xyz://test, a+) called at ...


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-03 20:10 UTC]
seek is called to *determine* the current position. SEEK_CUR with offset 0 is used. There's no intention in changing the file pointer. This is expected behavior.
 [2012-03-03 20:10 UTC]
-Status: Open +Status: Not a bug
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 22 13:01:29 2024 UTC