note 92007 added to function.fopen
| From: | ken dot gregg at rwre dot com | Date: | Sat, 04 Jul 2009 18:17:13 +0000 |
| Subject: | note 92007 added to function.fopen | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157924@lists.php.net to get a copy of this message | ||
I ran into a problem with || die("Couln't open file") in-line with fopen()
$write_handle = fopen($write_file, "w") || die("Couln't open file");
fclose($write_handle);
Returns a "supplied argument is not a valid stream resource" error in the fclose() and
file handle is 1. The returned file handle should be something like "Resource id #x".
Removing the || die() fixes the problem.
$write_handle = fopen($write_file, "w"); // || die("Couln't open
users_v2!");
----
Server IP: 208.69.120.35
Probable Submitter: 70.41.217.169
----
Manual Page -- http://www.php.net/manual/en/function.fopen.php
Edit -- https://master.php.net/note/edit/92007
Del: integrated -- https://master.php.net/note/delete/92007/integrated
Del: useless -- https://master.php.net/note/delete/92007/useless
Del: bad code -- https://master.php.net/note/delete/92007/bad+code
Del: spam -- https://master.php.net/note/delete/92007/spam
Del: non-english -- https://master.php.net/note/delete/92007/non-english
Del: in docs -- https://master.php.net/note/delete/92007/in+docs
Del: other reasons-- https://master.php.net/note/delete/92007
Reject -- https://master.php.net/note/reject/92007
Search -- https://master.php.net/manage/user-notes.php