ID: 31774 Updated by: [EMAIL PROTECTED] Reported By: php at lachoseinteractive dot net -Status: Open +Status: Feedback Bug Type: FTP related -Operating System: Linux & Mac OS X +Operating System: * PHP Version: 5CVS-2005-03-20 Assigned To: pollita New Comment:
Please try using this CVS snapshot: http://snaps.php.net/php5.1-latest.tar.gz For Windows: http://snaps.php.net/win32/php5.1-win32-latest.zip Previous Comments: ------------------------------------------------------------------------ [2005-01-31 12:41:10] php at lachoseinteractive dot net After more investigation, it turns out that the iterator reconnects to the server several times for each file of list in order to get SIZE information, etc instead of parsing a raw list from an FTP LIST command. Looks like DirectoryIterator needs optimization for use with ftp wrapper. ------------------------------------------------------------------------ [2005-01-31 02:32:17] php at lachoseinteractive dot net Description: ------------ Reading a directory with a DirectoryIterator using an ftp wrapper doesn't work well. Tested on 3 ftp servers. (proftp, ncftp, and ..unknown :-/). on 3 different machines and network. With proftp and ncftp, some items are missing from the retrieved directory list. (whereas it works well with readdir()), even with a directory containing no more than 2 or 3 files. This doesn't seem to be related to the nature of the file, but rather to its position in the list : add a new file to the directory, and the previously missing file would show up, while another one is now missing. On the third server (ftpperso.free.fr), the directory was correctly read. In all cases, retrieving the list is very slow, and often fails. Reproduce code: --------------- example: $dir = new DirectoryIterator("ftp://myftpserver.com/"); foreach ( $dir as $f ) { if ( $f->isDot() ) continue; echo $f->getFilename()."\n"; } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31774&edit=1