ID:               43166
 Updated by:       [EMAIL PROTECTED]
 Reported By:      shashank dot araokar at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Reproducible crash
 Operating System: Windows XP
 PHP Version:      5.2.4
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

http://www.php.net/filesize


Previous Comments:
------------------------------------------------------------------------

[2007-10-31 19:23:56] carsten_sttgt at gmx dot de

According to the PHP manual, you must use a string with the filepath as
parameter for filesize(), not a ressource.

Regards,
Carsten

------------------------------------------------------------------------

[2007-10-31 19:14:47] shashank dot araokar at gmail dot com

Description:
------------
The filesize() function always fails, even if the file opens up
properly and without warnings (it has been verified that there is no
file access issue and also that PHP knows that the file is there).

The warning is Warning filesize: stat failed for resource #xxx etc.

Please note that it has been confirmed at absolutely all permissions
have been granted to both the directory and the file and that the file
is existing and can also be opened by PHP.

Either this is a serious error or a function as ordinary as filesize()
is made too complex to use, which in itself is a problem!

This has been tested on several servers. If the file does not exist, a
proper warning is thrown, meaning that non-existence of the file is not
any issue.

Reproduce code:
---------------
<?php
        $file=fopen("uploads/test.txt","rb");
        $contents=fread($file, filesize($file));
        fclose($file);
?>

Expected result:
----------------
(no output, no warnings, no errors!)

Actual result:
--------------
Warning: filesize() [function.filesize]: stat failed for Resource id #3
in /www/110mb.com/w/a/v/i/c/l/e/_/wavicle/htdocs/test.php on line 4

Warning: fread() [function.fread]: Length parameter must be greater
than 0 in /www/110mb.com/w/a/v/i/c/l/e/_/wavicle/htdocs/test.php on line
4


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=43166&edit=1

Reply via email to