note 59701 added to function.fopen

From: Date: Tue, 13 Dec 2005 22:23:24 +0000
Subject: note 59701 added to function.fopen
Groups: php.notes 
Request: Send a blank email to php-notes+get-100089@lists.php.net to get a copy of this message
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." ---- Manual Page -- http://www.php.net/manual/en/function.fopen.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+59701 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+59701&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+59701&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+59701&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+59701&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+59701&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+59701&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+59701&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+59701&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#100089) next »