note 35999 added to function.fclose

From: Date: Mon, 22 Sep 2003 12:57:03 +0000
Subject: note 35999 added to function.fclose
Groups: php.notes 
Request: Send a blank email to php-notes+get-56901@lists.php.net to get a copy of this message
If you are attempting to write a file and your disk quota is exceeded then you may not get any error message, and neither fopen, fwrite or fclose reports any failure. You can check for this error by calling fflush before fclose. fflush returns false if there is a disk quota exceeded error. Example: $f1 = fopen($filename, "w"); $f2 = fputs($f1, $data); $f3 = fflush($f1); $f4 = fclose($f1); if (!$f1 || !$f2 || !$f3 || !$f4) { echo "Error writing file $filename";} (observed on PHP version 4.1.1 running on FreeBSD v. 4.7) ---- Manual Page -- http://www.php.net/manual/en/function.fclose.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35999 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35999&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35999&report=yes

« previous php.notes (#56901) next »