#21618 [NEW]: fopen on no existing files generates unexpected output.

From: Date: Mon, 13 Jan 2003 17:02:11 +0000
Subject: #21618 [NEW]: fopen on no existing files generates unexpected output.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-29881@lists.php.net to get a copy of this message
From: martin@kitv.co.uk Operating system: Apache on RedHat Linux PHP version: 4.2.3 PHP Bug Type: *General Issues Bug description: fopen on no existing files generates unexpected output. I planned to use the following function testing for a flag file 'offline_message.txt' to disable my application and contain an offline message. function isOffLine() { global $OffLineMessage; $OffLineMessage = "" ; $OffLineFilename = "offline_message.txt" ; if (!($fp = fopen($OffLineFilename, "r"))) { return false; } else { $OffLineMessage = file( $OffLineFilename ) ; return true; } } However bothe the fopen & file functions generates an unexpected and unwanted warning messages to the output stream. Warning: fopen("offline_message.txt", "r") - No such file or directory in /var/www/html/webmail/common.php on line 104 Warning: file("offline_message.txt") - No such file or directory in /var/www/html/webmail/common.php on line 105 -- Edit bug report at http://bugs.php.net/?id=21618&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=21618&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=21618&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=21618&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=21618&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=21618&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=21618&r=support Expected behavior: http://bugs.php.net/fix.php?id=21618&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=21618&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=21618&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=21618&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=21618&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=21618&r=dst IIS Stability: http://bugs.php.net/fix.php?id=21618&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=21618&r=gnused

« previous php.bugs (#29881) next »