Subject: FTP: LIST vs. NLST
To: None <firstname.lastname@example.org>
From: Trevin Beattie <email@example.com>
Date: 01/30/2001 12:48:28
I have recently run into a problem with the interpretation of RFC-959.
The authors of wu-ftpd claim that NLST should restrict its list to
regular files and exclude directories and symbolic links. However,
the only place I could find in the RFC's which distinguish directories
from regular files is in RFC-1127, which indirectly claims that
including directories in NLST output is a "bug". And this statement
is listed under "Proposed FTP extensions"; it is not part of an actual
In the official standard, RFC-959, the ONLY distinction made between
NLST and LIST is that NLST must return a machine-readable list of
names, while LIST may return a human-readable list. This follows
BSD's implementation of the ftp client, where the "dir" command is
documented to print a listing of the contents of a directory including
"any system-dependent information that the server chooses to include".
NetBSD Problem Report #8937 has suggested changing the implementation
of ftp to make "dir" and "ls" both use LIST. I believe this is a
mistake, as it removes the distinction between the commands.
Apparently the wu-ftp folks have interpreted "names of files" under
NLST to mean names of regular files. But if you read the paragraph
under LIST, it uses similar wording, "list of files". Neither
paragraph mentions "regular files" or "symbolic links". And remember
than on unix-like systems, directories and symbolic links ARE files,
just files of a special type.
Many RFC's prior to 959 have urged the network community to clarify
the distinction between LIST and NLST. Following is the complete list
of additions to the description of these two commands:
Under LIST, change "If the pathname specifies a directory" to "If
the pathname specifies a directory or other group of files", and
add the following sentence: "Since the information on a file may
vary widely from system to system, this information may be hard to
use automatically in a program, but may be quite useful to a human
Under NLST, add the following sentence: "This command is intended
to return information that can be used by a program to further
process the files automatically. For example, in the
implementation of a "multiple get" function."
As a side note to the last sentence, there are other ways an ftp
client can use both regular file and directory names in NLST, for
example tab-completion of filenames and expanding "mget" functionality
to recursively get files in subdirectories. (I have seen the latter
already implemented in one ftp client.)
... So, does anyone know how to get these comments to the RFC group?
Trevin Beattie "Do not meddle in the affairs of wizards,
firstname.lastname@example.org for you are crunchy and good with ketchup."