Despite there are many syncing/mirroring scripts for FTP servers out there, it might be worthwhile to bundle such a script with ftputil to:
I classify this issue as "minor" because the mirror script isn't that important for the functioning of ftputil.
How about add things like downloadtree() and uploadtree() into FTPHost objects directly?
I'm a bit hesitant to put all kind of stuff into the FTPHost class. I prefer to write a mirror script first, so I can get a better feeling if/how it fits into FTPHost.
Another reason to put the mirroring into a script first is to gain usage experience before committing to a concrete API in FTPHost.
I also think, that an FTP mirror script would be a better "playground" to experiment with FTP to FTP copy you mention in ticket #15.
What do you think?
I agree with that.
In my imagine, maybe there will be a module function like this:
def transfer(src_host, src, dst_host, dst, mode, exist): ... }} The "src_host" and "dst_host" are FTPHost-like objects, the default value can be "shutil" or something else indicate to local file system. The "src" and "dst" are the path of source file and target file, maybe it also can handle folder? The "exist" set the strategy when meet exist files, such as "overwrite when newer", "skip", "always overwrite", "resume", "auto rename", just as other ftp client does. (maybe here is a new feature request of "resume" operation or transfer a part of a file?) At first it's lied in the externel script, once it's proved mature, maybe it can be moved to the ftputil module directly. I hope I didn't ask for too much...
Sorry for my mistake, the content of last reply seems broken...
In my imagine, maybe there will be a module function like this:
def transfer(src_host, src, dst_host, dst, mode, exist): ...
The "src_host" and "dst_host" are FTPHost-like objects, the default value can be "shutil" or something else indicate to local file system. The "src" and "dst" are the path of source file and target file, maybe it also can handle folder? The "exist" set the strategy when meet exist files, such as "overwrite when newer", "skip", "always overwrite", "resume", "auto rename", just as other ftp client does. (maybe here is a new feature request of "resume" operation or transfer a part of a file?)
At first it's lied in the externel script, once it's proved mature, maybe it can be moved to the ftputil module directly.
I hope I didn't ask for too much...
Another idea is, once the "resume" and "fxp" operations are support by the low-level ftputil, maybe there can be another module defines something like "FTPTask".
A task can be a group of operation, it can start, stop, resume, queue, schedule, etc, even via mutiple sessions at the same time.
I must say, it's another story about a full-featured python ftp client, not the feature request of this library...
But if there is a full-featured library lied down, it's sure will be possiblely and much easier.