Ftp-WG: NLST vs MLSD
"D. J. Bernstein" <[email protected]> Sat, 12 Oct 2002 15:35:23 -0500
| Newsgroups | gmane.ietf.ftpext |
|---|---|
| Message-ID | <[email protected]> |
Frank da Cruz writes: > For decades it has been possible for FTP clients to execute commands like: > mget pics/mae-west-*.jpg And it's still possible. If you receive that command from the user, simply switch to the pics directory, do an NLST, extract the mae-west-* names, and retrieve those files one by one. What's the problem? Are you saying that your client tries to push the * processing over to the server? Sorry, but that isn't guaranteed by the FTP standard, and it isn't supported by all servers. You should be using the standard NLST mechanism instead. The UNIX ftpd and its offshoot wuftpd have, historically, accounted for most FTP servers on the Internet, but you shouldn't be relying on their wildcard quirks. There have always been servers that, quite reasonably and in full compliance with the protocol, don't imitate ftpd's wildcard processing. You would already know this if you had tested your client more thoroughly. By the way, this is orthogonal to the question of list format. > (in the "mae-west*.jpg" example > above, suppose these pictures were in a directory that contained > a million files, but you only wanted three of them). Reality check: What kind of idiot organizes his files that way? Do you realize how long it takes for a server to look through a million-file directory on a typical filesystem? Have you heard of subdirectories? ---D. J. Bernstein, Associate Professor, Department of Mathematics, Statistics, and Computer Science, University of Illinois at Chicago