Kevin Glick wrote:
> I'm running PHP 5.0.2 on IIS 6/Windows Server 2003. Below is a snippet of
> the code from a script that looks into the "news" directory for files
> ending
> in .txt. After it finds the files, I want to get the creation time of
> each
> file. The script finds all the files (in this case "blah.txt", but
> filectime gives me an error:
>
> "Warning: filectime() [function.filectime]: stat failed for blah.txt
> in..."
>
> (snip)...
> $dir = "../news/";
> $dh = opendir($dir);
> while (($filename = readdir($dh)) !== false) {
> if (strpos($filename, ".txt")) {
> $time = filectime($filename);
> ...
>
> Any ideas why? The user that the webserver runs as, has full permissions
> to
> the "news" directory, and all the files in it.
$filename only has "blah.txt" in it.
filectime has NO IDEA what directory you are messing around with.
You need something not unlike:
filectime("$dir/$filename");
Maybe someday somebody will add an optional argument to readdir() to
return the files as a full pathname... That would be nifty.
--
Like Music?
http://l-i-e.com/artists.htm
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php