|  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
From: frame at dynamiccreated dot de
New email:
PHP Version: OS:


 [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: Wed Jun 19 03:01:31 2024 UTC