Bug #11793 Updated: file_exists() and friends
| From: | frink at thepurplebuffalo dot net dot XXXXXX | Date: | Sat, 23 Feb 2002 06:22:05 +0000 |
| Subject: | Bug #11793 Updated: file_exists() and friends | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-852@lists.php.net to get a copy of this message | ||
ID: 11793
Updated by: frink@thepurplebuffalo.net.XXXXXX
Reported By: bf@ez.no
Status: Bogus
Bug Type: Scripting Engine problem
Operating System: Redhat Linux
PHP Version: 4.0.6
New Comment:
I was having trouble with the following code:
$date =
date "+%d-%b-%Y";
$data_file = "data/" . $date;
rtrim($data_file);
# $data_file = rtrim($data_file);
clearstatcache();
if( file_exists($data_file) ) {
$curr_data = "yes";
} else {
$curr_data = "no";
}
For the record the solution was to change the "rtrim" line to the one I
have commented out. I was thinking in perl. :)
Previous Comments:
------------------------------------------------------------------------
[2001-06-29 04:51:07] bf@ez.no
This was not a PHP problem.
------------------------------------------------------------------------
[2001-06-29 03:09:36] bf@ez.no
I'm having problem with file_exists(), is_file(),
file_size() since the upgrade to 4.0.6. It does not work
if I supply a variable as a filename. E.g.
file_exists( $var ); will return false even if the
variable contains a correct path.
file_exists( "path/to/file.txt" ); works.
Same for the is_file() and file_size();
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=11793&edit=1