fileatime() error

From: Ben (crescent_au_at_yahoo.com)
Date: 08/31/04


Date: 31 Aug 2004 08:16:33 -0700

Hi all,
I have a following function in an external file:

<?php
        function counter($hostaddr,$fname) {
                $currentfile="/".$hostaddr.$fname;
                echo $currentfile;
                if (file_exists($currentfile)) {
                  $fileatime = date("F d Y H:i:s.", fileatime($currentfile));
                  echo "testing...".$fileatime;
                }
............
............
?>

this function is called by another php file... my problem is on the
"if statement". The fileatime($currentfile) function doesn't seem to
work well.. If I leave this file as it is above, it doesn't show error
but later on the code, there is problem because of this... If I
comment out the "if" line and the "closing brace", then it gives me
the following error:

Warning: fileatime() [function.fileatime]: stat failed for
/localhost/index.php in D:\Apache Group\Apache2\htdocs\phpfunc.php on
line 7
testing...January 01 1970 11:00:00.

what's am i doing wrong? i just couldn't figure it out!

Hope someone can help me!
Thanx
Ben