Bug #61230 [Opn->Nab]: stream_seek() is receiving SEEK_CUR on mode 'a' or 'a+'.

From: Date: Sat, 03 Mar 2012 20:10:00 +0000
Subject: Bug #61230 [Opn->Nab]: stream_seek() is receiving SEEK_CUR on mode 'a' or 'a+'.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-168078@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=61230&edit=1

 ID:                 61230
 Updated by:         cataphract@php.net
 Reported by:        frame at dynamiccreated dot de
 Summary:            stream_seek() is receiving SEEK_CUR on mode 'a' or
                     'a+'.
-Status:             Open
+Status:             Not a bug
 Type:               Bug
 Package:            Streams related
 Operating System:   Windows
 PHP Version:        5.3.10
 Block user comment: N
 Private report:     N

 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------
[2012-03-01 23:48:56] 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 ...



------------------------------------------------------------------------



-- 
Edit this bug report at https://bugs.php.net/bug.php?id=61230&edit=1


Thread (2 messages)

« previous php.bugs (#168078) next »