gpt4 book ai didi

java - FTP LIST 命令响应

转载 作者:行者123 更新时间:2023-12-02 00:47:33 25 4
gpt4 key购买 nike

我正在尝试用 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.

关于java - FTP LIST 命令响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4521436/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com