From: [EMAIL PROTECTED] Operating system: Win 2000 Pro PHP version: 4CVS-2002-10-02 PHP Bug Type: Filesystem function related Bug description: filemtime reports existing file doesn't
When using the filemtime() function if i set a var in the script to the file to be tested it works fine, if i read the exat sme data in from an outside file it give a stat warning. Note this happens if i use a relitve or abosulte path. Below is the code and output to demonstrate: baseinfo PHP Version 4.3.0-dev -------------------------------------------------------------------------------- Test code -------------------------------------------------------------------------------- <?php print "<HR>baseinfo<BR>"; print ("PHP Version ".phpversion()); print "<HR>Test code<HR>"; show_source(__FILE__); print "<HR>Test Case<BR><HR>Using inside var<HR>"; $line2 = 'file=./webcam.jpg'; list ($id2,$value2) = split("=",$line2); $file_2 = $value2; print "got setting $value2<BR>"; print filemtime($file_2); print "<HR>Using read in var<HR>"; $settings = file("./webstat.ini"); $line = $settings[0]; list($id,$value) = split("=",$line); $file = $value; print "got setting $value<BR>"; print filemtime($file); print "<BR>"; ?> -------------------------------------------------------------------------------- Test Case -------------------------------------------------------------------------------- Using inside var -------------------------------------------------------------------------------- got setting ./webcam.jpg 1033559117 -------------------------------------------------------------------------------- Using read in var -------------------------------------------------------------------------------- got setting ./file.txt Warning: filemtime() [function.filemtime]: Stat failed for ./file.txt (errno=2 - No such file or directory) in c:\inetpub\wwwroot\webcam\test_case.php on line 18 -- Edit bug report at http://bugs.php.net/?id=19713&edit=1 -- Try a CVS snapshot: http://bugs.php.net/fix.php?id=19713&r=trysnapshot Fixed in CVS: http://bugs.php.net/fix.php?id=19713&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=19713&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=19713&r=needtrace Try newer version: http://bugs.php.net/fix.php?id=19713&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=19713&r=support Expected behavior: http://bugs.php.net/fix.php?id=19713&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=19713&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=19713&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=19713&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=19713&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=19713&r=dst