问题
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.
回答1:
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.
回答2:
You may have better luck with one of the cURL bindings such as pycURL.
来源:https://stackoverflow.com/questions/1088518/python-libraries-for-ftp-upload-download