Could someone explain how I could set some excecution time limit for this function - Occasionally the file open and read can take ages and really slows things down.

Is there any way that I could get the open and read to abandon if it is not completed within say 1 second?

Cheers for the help - script below.

function OpenGrab($GrabURL, $Bytes, &$Grab)
$rf = fopen("$GrabURL", "r");
$file = fread($rf, $Bytes);
if ($file)
/* do some execution */

$Grab = $file
return $Grab;