Posted by Hello on 07/09/05 06:27
Hello,
I am trying to efficiently detect if file exist at the specific URL where
URL points to a completely different web server than where the script is
being run at. I need constatnly check for a log file on another server and I
need my script to detect that file there exists when the script checks for
it. Right now I have the only way to see if file exists only by downloading
the whole file with the following piece of code:
ob_start();
$file = @readfile($url);
$contents = ob_get_contents();
ob_end_clean();
and see if read was empty or not. Problem is that if the log will happen to
be a few megs then the alarm will be delayes since it will take a few mins
to download the whole file first. Is there a more efficient way to check for
existence of the file on the remote webserver without downloading the file
and checking for the length?
I'd take any idea you might have. Thanks.
Navigation:
[Reply to this message]
|