本文介绍了ftplib MLSD 命令给出 500 Unknown command的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用 ls = f.mlsd() 从 ftp 获取文件列表和时间戳,但它给了我

I have been using ls = f.mlsd() to get list of files and timestamp from ftp but it gives me

ftplib.error_perm: 500 Unknown command

ftp服务器有问题吗?我需要在服务器上安装任何东西才能让这个命令正常工作

Is there any problem with ftp server? do i need to install anything on the server to get this command working

推荐答案

事实上,MLSD 只不过是 RFC 3659 中引入的协议扩展,某些 FTP 服务器可能不支持.如果您关心可移植性,最好改用 f.nlst().

In the fact, MLSD is nothing but a protocol extension introduced in RFC 3659 that may be not supported by some FTP servers. If you care about portability, it's better to use f.nlst() instead.

如果您可以接受更改服务器上的某些内容,那么我建议您切换到 proftpd,它具有 MLSD 支持作为其 mod_facts 扩展的一部分.

If changing something on server is acceptable for you, then I suggest you switching to proftpd which has MLSD support as a part of it's mod_facts extension.

这篇关于ftplib MLSD 命令给出 500 Unknown command的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-17 03:53