ftp_rawlist problems

From: Date: Sat, 02 Nov 2002 00:27:05 +0000
Subject: ftp_rawlist problems
Groups: php.general 
Request: Send a blank email to php-general+get-122493@lists.php.net to get a copy of this message
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

« previous php.general (#122493) next »