The format of the data returned by the FTP LIST command?

I'm in the middle of writing an FTP server, but I'm a little confused about the format to send a list of files.

Using 2 terminals and an FTP client, I was able to start a simple FTP exchange. However, I was not sure which format would send the file lists.

Is there any accepted format? Which columns should be used?

+6
list command format ftp
source share
3 answers

This is what the RFC has to say:

Data transmission is carried out on the data channel type ASCII or type EBCDIC. (The user must ensure that the TYPE is ASCII or EBCDIC). Since file information can vary greatly from system to system, this information can be difficult to use automatically in the program, but can be very useful to the user.

Thus, the result will not be automatically analyzed.

+3
source share

The standard does not define the format of the list of directories sent / received using the LIST command. Most servers use the Unix list format (I don’t know if it is defined in any document, but it is quite simple to generate and analyze), some use the DOS / Windows format. Other formats (over 400, as far as I know) are used worldwide, but Unix has become the de facto standard.

Now there is an important thing to implement: the MLST and LMSD extension commands defined in RFC 3659 . They determine how to create and obtain a machine-readable listing, which is very welcome on any modern FTP server.

+3
source share
0
source share

All Articles