php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #11793 file_exists() and friends
Submitted: 2001-06-29 03:09 UTC Modified: 2001-06-30 00:02 UTC
From: bf at ez dot no Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.0.6 OS: Redhat Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: bf at ez dot no
New email:
PHP Version: OS:

 

 [2001-06-29 03:09 UTC] bf at ez dot 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();

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-06-29 04:51 UTC] bf at ez dot no
This was not a PHP problem.
 [2002-02-23 01:22 UTC] frink at thepurplebuffalo dot net dot XXXXXX
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. :)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed May 07 22:01:27 2025 UTC