题
我正在尝试在Java中编写FTP服务器,并降低基本功能,但是我无法找到或找到任何信息 LIST
命令。
LIST -a
发送一个文件列表
drwxrwxrwx 1 stefan stefan 0 Jan 1 1970 personaluploads
-rwxrwxrwx 1 stefan stefan 0 Jan 1 1970 serverflags.txt
-rwxrwxrwx 1 stefan stefan 0 Jan 1 1970 serveroptions.txt
-rwxrwxrwx 1 stefan stefan 0 Jan 1 1970 levels_npcserver.txt
在数据连接上。
我应该回来什么 LIST
?我是否通过数据连接或控制连接发送它?
谢谢您的帮助。
解决方案
看 RFC 959 - File Transfer Protocol
. 。它具有您需要的所有信息。
LIST (LIST) This command causes a list to be sent from the server to the passive DTP. If the pathname specifies a directory or other group of files, the server should transfer a list of files in the specified directory. If the pathname specifies a file then the server should send current information on the file. A null argument implies the user's current working or default directory. The data transfer is over the data connection in type ASCII or type EBCDIC. (The user must ensure that the TYPE is appropriately ASCII or EBCDIC). 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 user.
不隶属于 StackOverflow