用于 FTP 上传/下载的 Python 库?
好的,先说一下:
我们有一个用 python 编写的服务/守护进程,用于监视远程 ftp 站点。 这些站点不在我们的控制之下,其中一些站点我们没有删除/重命名/写入访问权限,有些站点还运行非常旧的 ftp 软件。 这样某些命令就不起作用。 这些 ftp 之间没有标准化,并且它们不在我们(政府)的控制范围内。
大约一年前,我为内部编写了一个 ftp 包装库,它基本上添加了诸如恢复上传/恢复下载/验证文件当前未写入等内容。问题是我们很快发现,由于太多运行奇怪/非标准软件的 ftp 服务器我们一直在与包装库/ftplib 作斗争。
基本上我已经放弃了 ftplib。 还有其他选择吗? 我已经研究了大多数 ftp 替代品,它们都缺少一个或另一个关键功能组件。
无论选择是什么,它都必须运行 python 2.5.2(我们无法更改)。 并且必须在 Linux/Windows/HP-UX 上运行。
更新:
抱歉,我忘了告诉您我查看过的替代方案:
- ftputil,问题是它不支持恢复上传/下载以及部分下载给定偏移量的文件之类的内容。
- Pycurl 看起来不错,我会再看看。
Okay so a bit of forward:
We have a service/daemon written in python that monitors remote ftp sites. These sites are not under our command, some of them we do NOT have del/rename/write access, some also are running extremely old ftp software. Such that certain commands do not work. There is no standardization among any of these ftp's, and they are out of our control(government).
About a year ago i wrote a ftp wrapper library for in house that basically adds in stuff like resume upload/resume download/verifying files are not currently being written to, etc. The problem is we soon found out is that due to so many of the ftp servers running werid/non standard software we were constantly fighting with the wrapper library/ftplib.
Basically I've given up on ftplib. Is there an alternative? I've looked at most of the ftp alternatives all of them are missing one or another key component of functionality.
What ever the choice is, it must run for python 2.5.2 (we cannot change). and must run on Linux/Windows/HP-UX.
Update:
Sorry i forgot to tell you alternatives i looked at:
- ftputil, problem is it does not support resume upload/download and stuff like partially downloading files given an offset.
- Pycurl looked good, i'll look at it again.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您没有提及您已经看过哪些替代方案。 ftputil 是其中之一吗?
http://ftputil.sschwarzer.net/trac/wiki/Documentation
如果您当您尝试围绕各种服务器实现的边缘情况进行编码时,您最好查看 Mozilla/Firefox 使用的代码。 我想这是他们必须经常处理的事情之一。
You don't mention which alternatives you've looked at already. Is ftputil one of them?
http://ftputil.sschwarzer.net/trac/wiki/Documentation
If you're trying to code around edge cases from various server implementations, you might be better off looking at the code used by Mozilla/Firefox. I imagine this is one of the things they have to deal with constantly.
您可能会更幸运地使用其中一种 cURL 绑定,例如 pycURL。
You may have better luck with one of the cURL bindings such as pycURL.