|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2002-10-02 06:56 UTC] eflammer at oddpost dot com
[2002-10-02 07:11 UTC] hholzgra@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Nov 27 22:00:01 2025 UTC |
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