php.net |  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
 [2012-03-01 23:48 UTC] frame at dynamiccreated dot de
Description:
------------
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 ...


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-03-03 20:10 UTC] cataphract@php.net
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] cataphract@php.net
-Status: Open +Status: Not a bug
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 09:01:30 2024 UTC