#29959 [Bgs->Opn]: Resource returned by fopen has type 'stream'
| From: | mccarthy36 at earthlink dot net | Date: | Fri, 03 Sep 2004 15:12:01 +0000 |
| Subject: | #29959 [Bgs->Opn]: Resource returned by fopen has type 'stream' | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-65689@lists.php.net to get a copy of this message | ||
ID: 29959
User updated by: mccarthy36 at earthlink dot net
Reported By: mccarthy36 at earthlink dot net
-Status: Bogus
+Status: Open
Bug Type: Filesystem function related
Operating System: Linux
PHP Version: 4.3.8
New Comment:
Not to be combative, but it's not _expected_ based on what the manual
says.
* fopen() returns a resource
* get_resource_type() returns a string representing the type of the
resource
* Appendix K gives 'file' as the resource type name created by fopen()
Would you please say specifically which part of the manual I should
double-check to better understand the situation?
Thank you
Previous Comments:
------------------------------------------------------------------------
[2004-09-03 04:39:04] iliaa@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
This is expected.
------------------------------------------------------------------------
[2004-09-03 00:03:46] mccarthy36 at earthlink dot net
Description:
------------
The resource returned by fopen() (when used to open a file) is reported
as type 'stream', not 'file'.
I'm not sure if this is a documentation problem or an fopen() problem.
Appendix K doesn't list any functions as returning resources of type
'stream'. But, as 'stream' seems more generic, from my perspective it
seems desirable to have the resource returned by fopen() identified as
'file' as described in the documentation.
Reproduce code:
---------------
$file = fopen( 'file.txt', 'r' );
var_dump( get_resource_type( $file ) );
Expected result:
----------------
Appendix K. List of Resource Types states that 'file' is the type of
resource returned by fopen().
Actual result:
--------------
'stream' is reported as the type of the resourced returned by fopen().
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29959&edit=1