FTP LIST 命令返回的数据格式?

发布于 2024-10-09 14:56:46 字数 137 浏览 0 评论 0原文

我正在编写一个 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 技术交流群。

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

发布评论

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

评论(3

╰ゝ天使的微笑 2024-10-16 14:56:46

这是 RFC 所说的:

数据传输通过 ASCII 类型或 EBCDIC 类型的数据连接进行。 (用户必须确保 TYPE 是适当的 ASCII 或 EBCDIC)。由于文件上的信息可能因系统而异,因此这些信息可能很难在程序中自动使用,但对于人类用户可能非常有用。

因此,结果不会被自动解析。

This is what the RFC has to say:

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.

So, the result is not expected to be automatically parsed.

九公里浅绿 2024-10-16 14:56:46

该标准没有定义使用 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.

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