php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #45303 Opening php:// wrapper in append mode results in a warning
Submitted: 2008-06-18 18:24 UTC Modified: 2008-11-03 16:59 UTC
Votes:3
Avg. Score:3.3 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:1 (33.3%)
Same OS:3 (100.0%)
From: nforbes@php.net Assigned:
Status: Closed Package: Streams related
PHP Version: 5.2CVS-2008-06-18 (CVS) OS: Linux (Debian)
Private report: No CVE-ID:
 [2008-06-18 18:24 UTC] nforbes@php.net
Description:
------------
When attempting to fopen any php:// wrapper in append mode (which 
should be equivalent to writing), PHP gives the following warning 
before returning the resource:

fopen(): cannot seek on a pipe

The resource returned behaves properly.

Reproduce code:
---------------
<?php
var_dump(fopen("php://stdout", "a"));
var_dump(fopen("php://stdin", "a"));
var_dump(fopen("php://stderr", "a"));
?>

Expected result:
----------------
Warning: fopen(): cannot seek on a pipe in <...> on line 2
resource(5) of type (stream)

Warning: fopen(): cannot seek on a pipe in <...> on line 3
resource(6) of type (stream)

Warning: fopen(): cannot seek on a pipe in <...> on line 4
resource(7) of type (stream)


Actual result:
--------------
resource(5) of type (stream)
resource(6) of type (stream)
resource(7) of type (stream)


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-11-03 16:59 UTC] lbarnaud@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Fri Apr 18 15:02:26 2014 UTC