FTP LIST 命令返回的数据格式?
我正在编写一个 FTP 服务器,但我对发送文件列表的格式有点困惑。
使用 2 个终端和一个 FTP 客户端,我能够运行一个简单的 FTP 交换。但是,我不太确定发送文件列表的格式。
是否有某种可接受的格式?我应该使用哪些色谱柱?
I'm in the middle of writing an FTP server but I'm a little confused about what format to send the file list in.
Using 2 terminals and an FTP client, I was able to run through a simple FTP exchange. However, I wasn't really sure what format to send the file lists in.
Is there some accepted format? What columns should I use?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这是 RFC 所说的:
因此,结果不会被自动解析。
This is what the RFC has to say:
So, the result is not expected to be automatically parsed.
该标准没有定义使用 LIST 命令发送/接收的目录列表的格式。大多数服务器使用 Unix 列表格式(不知道它是否在任何文档中定义,但生成和解析相当简单),有些使用 DOS/Windows 格式。其他格式(据我所知超过 400 种)在全球范围内使用,但 Unix 格式已成为事实上的标准。
现在有重要的事情需要实现:MLST 和 LMSD 扩展命令,在 RFC 3659 中定义。他们定义了一种生成和获取机器可读列表的方法,这在任何现代 FTP 服务器中都非常受欢迎。
The standard doesn't define format of the directory listing sent/received using LIST command. Most servers use Unix listing format (don't know if it's defined in any document, but it's rather simple to generate and parse), some use DOS/Windows format. Other formats (over 400 as far as I know) are used worldwide, but the Unix one has become a standard de-facto.
Now there's important thing to implement: MLST and LMSD extension commands, defined in RFC 3659. They define a way to produce and obtain machine-readable listing, which is very welcome in any modern FTP server.
RFC 很差,但有一些不错的链接:
https:// files.stairways.com/other/ftp-list-specs-info.txt
http://cr.yp.to/ftp/list/binls.html
The RFC is poor there, but there are some nice links:
https://files.stairways.com/other/ftp-list-specs-info.txt
http://cr.yp.to/ftp/list/binls.html