MLSD
Click on the red underlined text to get to the source
... commands are added: "SIZE", "MDTM", "MLST", and "MLSD". The existing
command "REST" is modified. Of those, the "SIZE" and "MDTM ...
... be transmitted over a data connection (as part of the result of a
LIST, NLST, or MLSD command), such pathnames are best avoided.
Implementors ...
...
The MLST and MLSD commands are intended to standardize the file and
directory information returned by the server-FTP ...
...
Two commands are defined, MLST and MLSD. MLST provides data about
exactly the object named on its command line ...
... MLST provides data about
exactly the object named on its command line, and no others. MLSD,
on the other, lists the contents of a directory if a directory is
named, otherwise a 501 reply is returned. In either case, if no
...
... MLST to send a one-line response, describing the current directory
itself, and MLSD to list the contents of the current directory.
In the following, the term MLSx ...
... Unicode and "raw" forms as
arguments, and in responses both to the MLST and MLSD commands, and
all other FTP commands which take pathnames as arguments.
...
...
The MLST and MLSD commands each allow a single optional argument.
This argument may be either a directory name or, for MLST only, a
...
... current working
directory, or any TVFS fully qualified pathname, may be given. If a
directory name is given then MLSD must return a listing of the
contents of the named directory, otherwise it issues a 501 reply, and
does not open a data connection ...
... data connection.
If no argument is given then MLSD must return a listing of the
contents of the current working directory, and MLST ...
... than as is specified below, is ever returned in the output of an MLST
or MLSD command.
If the Client ...
... the response are to be treated as being a part of the pathname.
If the command was an MLSD command, the server will open a data
connection as indicated in section 3.2 of STD 9, RFC 959std9 ...
...
The data connection opened for a MLSD response shall be a connection
as if the "TYPE L 8", "MODE S", and "STRU F" commands had been given,
...
... file/directory flag.
The complete format for a successful reply to the MLSD command would
be:
...
... 959std9 [3] are possible in response to the MLST and MLSD commands.
In particular, syntax errors can generate 500 or 501 replies. Giving
a pathname that exists but is not a directory as the argument to a
...
... In particular, syntax errors can generate 500 or 501 replies. Giving
a pathname that exists but is not a directory as the argument to a
MLSD command generates a 501 reply. Giving a name that does not
exist, or for which access permission (to obtain directory
information as requested) is not granted will elicit a 550 reply.
...
... be returned.
File names returned in the output from an MLSD command SHOULD be
unqualified names within the directory named, or the current
directory if no argument was given. That is, the directory named in
...
... unqualified names within the directory named, or the current
directory if no argument was given. That is, the directory named in
the MLSD command SHOULD NOT appear as a component of the file names
returned.
...
... If the server-FTP process is able, and the "type" fact is being
returned, it MAY return in the MLSD response, an entry whose type is
"cdir", which names the directory from which the contents of the
listing were obtained. Where TVFS ...
... server-FTP. Where more than one name
exists, multiple of these entries may be returned. In a sense, the
"cdir" entry can be viewed as a heading for the MLSD output.
However, it is not required to be the first entry returned, and may
occur anywhere within the listing.
...
... 3]) giving a name of type "cdir" from the
listing returned, and from that point reference the files returned in
the MLSD response from which the cdir was obtained by using the file
name components of the listing.
...
... The type=cdir fact indicates the listed entry contains a pathname of
the directory whose contents are listed. An entry of this type will
only be returned as a part of the result of an MLSD command when the
type fact is included, and provides a name for the listed directory,
...
... FTP, this name may be used to
construct pathnames with which to refer to the files and directories
returned in the same MLSD output (see section 6.2). These pathnames
are only expected to work when the server-PI's position in the NVFS ...
... NVFS
file tree is the same as its position when the MLSD command was
issued, unless a fully qualified pathname results.
...
... using RETR, etc., but should (permissions permitting) be able to be
the object of an MLSD command.
...
...
If present, which will occur only in the response to a MLSD command
when the type fact is included, the type=pdir entry represents a
pathname of the parent directory of the listed directory. As well as
...
... For directories, this value should alter whenever a change occurs to
the directory such that different file names would (or might) be
included in MLSD output of that directory.
modify-fact = "Modify" "=" time-val
...
... The "l" permission applies to the directory file types, and indicates
that the listing commands, LIST, NLST, and MLSD may be applied to the
directory in question.
...
... MLSD of a directory ...
... MLSD tmp
S> 150 BINARY connection open for MLSD tmp
D> Type=cdir;Modify=19981107085215;Perm=el; tmp
D> Type=cdir;Modify=19981107085215;Perm=el; /tmp
...
... D> Type=file;Size=224907;Modify=19980615100045;Perm=r; uar.1.2.3.sit.hqx
D> Type=file;Size=1024990;Modify=19980130010322;Perm=r; cap60.pl198.tar.gz
S> 226 MLSD completed
In this example notice that there is no leading space on the fact
...
... of "type=cdir" have been given. These show two alternate names for
the directory listed, one a fully qualified pathname, and the other a
local name relative to the servers current directory when the MLSD
was performed. Note that all other file names in the output are
relative to the directory listed, though the server could, if it
...
... S> Type=dir;Perm=el;Unique=keVO1+ZF4 test
S> 250 End
C> MLSD test
S> 150 BINARY connection open for MLSD ...
... MLSD test
S> 150 BINARY connection open for MLSD test
D> Type=cdir;Perm=el;Unique=keVO1+ZF4; test
D> Type=pdir;Perm=e;Unique=keVO1+d?3; ..
...
... D> Type=file;Perm=r;Unique=keVO1+1G4; file3
D> Type=file;Perm=r;Unique=keVO1+1G4; file4
S> 226 MLSD completed
C> MLSD test/incoming
...
... MLSD test/incoming
S> 150 BINARY connection open for MLSD test/incoming
D> Type=cdir;Perm=cpmel;Unique=keVO1+7G4; test/incoming
D> Type=pdir;Perm=el;Unique=keVO1+ZF4; ..
...
... D> Type=file;Perm=rf;Unique=keVO1+1G4; file6
D> Type=dir;Perm=cpmdelf;Unique=keVO1+!s2; empty
S> 226 MLSD completed
For the purposes of this example the fact set requested has been
...
... S> type=dir;unique=AQkAAAAAAAABCAAA; /
S> 250 End.
C> MLSD
S> 150 Opening ASCII mode data connection ...
... D> type=dir;unique=AQkAAAAAAAABQAEA; winstuff
S> 226 Listing completed.
C> MLSD linux
S> 150 Opening ASCII ...
... MLSD
S> 150 BINARY connection open for MLSD .
D> Type=cdir;Modify=19990219183438; /iana/assignments
D> Type=pdir;Modify=19990112030453; ..
...
... D> Type=file;Size=44242;Modify=19990217230400; character-sets
D> Type=file;Size=1947;Modify=19990209215600; operating-system-names
S> 226 MLSD completed
C> MLSD media-types ...
... media-types
S> 150 BINARY connection open for MLSD media-types
D> Type=cdir;Modify=19990219073522; media-types ...
... D> Type=file;Size=30249;Modify=19990218032700; media-types
S> 226 MLSD completed
C> MLSD character-set-info
...
... MLSD character-set-info
S> 150 BINARY connection open for MLSD character-set-info
D> Type=cdir;Modify=19990112033515; character-set-info
D> Type=cdir;Modify=19990112033515; /iana/assignments/character-set-info
...
... D> Type=file;Size=552;Modify=19970320130000; ibm866
D> Type=file;Size=922;Modify=19960505140000; windows-1258
S> 226 MLSD completed
C> MLSD languages ...
... languages
S> 150 BINARY connection open for MLSD languages
D> Type=cdir;Modify=19990112033529; languages ...
... This example shows some of the IANA maintained files that are
relevant for this specification in MLSD format. Note that these
listings have been edited by deleting many entries, the actual
listings are much longer.
...
... independent strings are required.
Note first that the "MLSD" command, shown here as "MlsD" is case
independent. Clients may issue this command in any case, or
...
... C> MlsD
S> 150 BINARY connection open for MLSD .
D> Type=pdir;Modify=19990929011228;Perm=el;Unique=keVO1+ZF4; ..
D> Type=file;Size=4096;Modify=19990929011440;Perm=r;Unique=keVO1+Bd8; FILE2
...
... D> Type=file;Size=4096;Modify=19990929011440;Perm=r;Unique=keVO1+Bd8; File2
D> Type=file;Size=4096;Modify=19990929011440;Perm=r;Unique=keVO1+bd8; FILE1
S> 226 MLSD completed
Next, notice the labels of the facts. These are also case-
...
...
Note that this server gives fully qualified pathnames for the "pdir"
and "cdir" entries in MLSD listings. Also notice that this server
does, though it is not required to, sort its directory listing
outputs. That may be an artifact of the underlying file system ...
... D> Type=file;Size=17729;Unique=AAD/AAAABJ8; ftpd.cat8
S> 226 MLSD complete.
This examples shows yet another server implementation, showing a
...
... MLST". Also note that the facts
requested were modified between the "MLST" and "MLSD" commands,
though that exchange has not been shown here.
...
... S> 227 Entering Passive Mode (127,0,0,1,255,46)
C> MLSD
S> 150 I tink I tee a trisector tree
...
... S> 227 Entering Passive Mode (127,0,0,1,255,42)
C> MLSD dir
S> 150 I tink I tee a trisector tree
...
... S> 227 Entering Passive Mode (127,0,0,1,255,40)
C> MLSD
S> 150 I tink I tee a trisector tree
...
... S> 227 Entering Passive Mode (127,0,0,1,255,36)
C> MLSD
S> 150 I tink I tee a trisector tree
...
... S> 227 Entering Passive Mode (127,0,0,1,255,34)
C> MLSD
S> 150 I tink I tee a trisector tree
...
... server-FTP process that
supports MLST, and MLSD, plus internationalization of pathnames, MUST
indicate that this support exists. It does this by including a MLST ...
...
Note that there is no distinct FEAT output for MLSD. The presence of
the MLST feature indicates that both MLST ...
... improving the information displayed to an end user.
Note, there is no "OPTS MLSD" command, the fact names set with the
"OPTS MLST" command apply to both MLST ...
... "OPTS MLST" command apply to both MLST and MLSD commands.
Servers are not required to accept "OPTS MLST ...
... The facts named in the response are those that the server will now
include in MLST (and MLSD) response, after the processing of the
"OPTS MLST" command. Any facts from the request not supported by the
server ...
