问题描述
我一直在使用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.
如果您可以接受在服务器上进行某些更改,那么我建议您切换到具有MLSD支持的proftpd,并将其作为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个未知命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!