#41858 [Opn->Bgs]: filesize() problem (bogus, please delete)

From: Date: Sat, 30 Jun 2007 02:15:18 +0000
Subject: #41858 [Opn->Bgs]: filesize() problem (bogus, please delete)
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-114479@lists.php.net to get a copy of this message
ID: 41858 Updated by: rasmus@php.net Reported By: caleblangeslag at hotmail dot com -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: Windows XP Home SP2 PHP Version: 4.4.7 New Comment: User-requested bogus Previous Comments: ------------------------------------------------------------------------ [2007-06-30 00:23:48] caleblangeslag at hotmail dot com I'm sorry, this bug report has been determined invalid. Please remove this bug from the listings. It has been determined that the file unexepectedly no longer contains content however I am aware this is NOT caused by PHP in anyway. Sorry for the inconvenience. ------------------------------------------------------------------------ [2007-06-29 21:25:22] caleblangeslag at hotmail dot com Description: ------------ filesize() returns '0' with any file and does not raise an error even though error_reporting is enabled. Also keep in note that I am using the software bundle named "XAMPP" and have upgraded the version of PHP 4. I've also checked the existance of the file. I can include the file using include() perfectly, however filesize() only returns 0 but not an error. When I change $filename to an invalid filename, filesize() does produce an error. I've also tried clearstatcache() and it made no difference. Reproduce code: --------------- class classname { function somefunction() { $filename = "tpl/default/nav.inc.php"; $handle = fopen($filename, 'r'); // Works (doesn't return FALSE) $content = fread($handle,filesize($filename)); // fails because filesize() returns 0. } } Expected result: ---------------- Contents of the file Actual result: -------------- Warning: fread() [function.fread]: Length parameter must be greater than 0. in C:\Program Files\xampp\htdocs\KeenManager\include\core.php on line 1411 (Where line 1411 is: $content = fread($handle,filesize($filename)); ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=41858&edit=1

« previous php.bugs (#114479) next »