Posted by nemo on 07/09/05 10:55
On Sat, 09 Jul 2005 03:27:21 GMT, "Hello" <no-emai@sorry.com> wrote:
>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.
>
Does
http://uk2.php.net/manual/en/function.file-exists.php
help?
[Back to original message]
|