1

您好,我在下面有一个简单的函数来列出 ftp 服务器上的所有文件。

import ftputil
ftp = ftputil.FTPHost("3.xxx.xxx.xx","xxxxxxxx", "xxxxx")
for (Root, dirs, files) in ftp.walk(Root) : #Iterate over remote file
    for fileName in files :
        list[Root+ "/"] = fileName
ftp.close()

有时列表做得很好,但有时我得到错误:ftputil.ftp_error.FTPOSError:10054 或 ftputil.ftp_error.FTPOSError:10060

不幸的是,服务器位于我无法修改的防火墙后面。但我的问题是,我是否正确使用了 ftputil 库?我是否因为打开了许多连接而收到这些错误?是否可以在不更改防火墙属性的情况下修复这些错误?

4

0 回答 0