note 114929 added to function.fclose

From: Date: Mon, 28 Apr 2014 20:38:14 +0000
Subject: note 114929 added to function.fclose
Groups: php.notes 
Request: Send a blank email to php-notes+get-199365@lists.php.net to get a copy of this message
if you want to daysychain a filehandle through some functions and each function is allowed to close th file you might look in a following function first, if the handle is still valid. Opening a file, there often will be used a code like if (!$fh = fopen($filename, $mode)) return false; But if you possably have closed the file and you want to check that, a smililar statement would not work. DOES NOT WORK: if (!$fh) end_of_chain(); use beter: if (is_resource($fh)) end_of_chain(); ---- Server IP: 87.106.1.137 Probable Submitter: 80.140.115.157 ---- Manual Page -- http://php.net/manual/en/function.fclose.php Edit -- https://master.php.net/note/edit/114929 Del: integrated -- https://master.php.net/note/delete/114929/integrated Del: useless -- https://master.php.net/note/delete/114929/useless Del: bad code -- https://master.php.net/note/delete/114929/bad+code Del: spam -- https://master.php.net/note/delete/114929/spam Del: non-english -- https://master.php.net/note/delete/114929/non-english Del: in docs -- https://master.php.net/note/delete/114929/in+docs Del: other reasons-- https://master.php.net/note/delete/114929 Reject -- https://master.php.net/note/reject/114929 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#199365) next »