FTP LIST 命令响应

发布于 2024-10-09 07:42:21 字数 515 浏览 6 评论 0原文

我正在尝试用 Java 编写一个 FTP 服务器并拥有基本功能,但我无法弄清楚或找到有关 LIST 命令的任何信息。

发送文件列表

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 -a通过数据连接

。我应该只用 LIST 返回什么?我是通过数据连接还是控制连接发送它?

感谢您的帮助。

I'm trying to write an FTP server in Java and have the basic functionality down, but I can't figure out or find any information on the LIST command.

LIST -a sends a list of files like

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

over the data connection.

What am I supposed to return with just LIST? Do I send it over the data connection or the control connection?

Thanks for the help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

×纯※雪 2024-10-16 07:42:21

请参阅 RFC 959 - 文件传输协议。它有您需要的所有信息。

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.

See RFC 959 - File Transfer Protocol. It has all the info you need.

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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文