note 59701 deleted from function.fopen by nlopess
| From: | nlopess@php.net | Date: | Mon, 26 Dec 2005 11:30:43 +0000 |
| Subject: | note 59701 deleted from function.fopen by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-100725@lists.php.net to get a copy of this message | ||
Note Submitter: michael at NAUGHTfroodSPAM dot org
----
Passing in an unexpected value for the second argument, $mode, will produce weird effects - in my
case, I received error messages like:
Warning: 'fopen(/path/to/file): failed to open stream: Success'
fopen() will still return FALSE in these cases.
This has particular relevance to applications making use of classes in PEAR's "File"
package; you won't see the error message (because of @ suppression in File::_getFilePointer()),
and it's very likely that you don't have the FILE_MODE_x constants defined (I've
found you have to explicitly require/include File.php; including something that then includes
File.php won't define the constants in the calling scope). If the constants are undefined and
you're not monitoring NOTICE-level errors, then you're going to miss the one that shows
the undefined constant being assumed to be "FILE_MODE_whatever."