I'm writing a script which crawls through ftp servers, retrieving file
listings and saving them to a DB so they may be searched.

What happens, is the script connects to the ftp server, and asks for a
listing of a directory. The ftp server apparentally sends the script the
file listing, but then the script hangs. I have absolutely no idea what
causes the problem.
To combat this problem, I have a loop which keeps looping until ftp_rawlist
actually returns something valid.
 $files = false;
 while (! is_array($files))
 {
  $files = ftp_rawlist($conn, $dir);
 }
That, along with
ftp_set_option($conn, FTP_TIMEOUT_SEC, 3);
Seems to fix the problem for now, but I would still like to know what's
going on.

Please note...
I'm running PHP 4.2.1 as a module with apache 1.3.x on a win2k machine. The
server I am using for testing, if it should make any difference, is
Filezilla 0.7.2.
Also, this problem does not occur every time a directory listing is
requested, but perhaps every 15-20 directories. In any case, which directory
php stalls on is random.

If anyone else has ever encountered this problem, or has any idea what is
going on, I would be very interested in hearing what you have to say :).

- Alex



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to