[Twisted-Python] Example of FTPClient.stor()?

Andrew Bennetts andrew-twisted at puzzling.org
Thu Dec 4 22:27:56 EST 2003

On Thu, Dec 04, 2003 at 12:57:49PM -0500, Fred L. Drake, Jr. wrote:
> Oisin Mulvihill writes:
>  > I had trouble grappling with this  as well. As far as I remember stro() 
>  > just refers to
>  > the storeFile() function in the code.
> In the FTPClient implementation, yes.  It doesn't exist in IFTPShell
> or FTPAnonymousShell though, which is what makes me think that it is
> either a legacy name for the method maintained for backward
> compatibility (in which case a comment would clarify immensely), or an
> accident of implementation (in which case the storeFile() name can
> probably be removed or documented differently).  If neither of those
> is the case, then it needs better documentation.

Currently the FTPClient and FTP (server) implementations don't share any
code (although ftp.py recently got a new maintainer, Jonathan Simms, who is
working on fixing this), so there's not much you can usefully infer by
comparing the server and client implementations at the moment. :/

I wrote the bulk of the FTPClient code, and if I recall correctly, I think I
intended 'storeFile' to be the preferred name, and 'stor' to be an alias for
people who know about the details of how FTP looks on the wire, or who were
already familiar with the standard library's ftplib.  In retrospect, I'm not
sure this was a good decision.

The implementation of stor is simply:

    stor = storeFile

so it doesn't matter which name you choose.

I think we should probably decide which name is preferred, clearly document
it, and deprecate the other one.  The same applies to retr/retrieveFile.

>  > Attached should be an example of the final solution I came up with to do 
>  > a storeFile().
>  > 
>  > Hopefully this is of some use to you.
> Thanks!  I'll take a look at your client code.

Also, look twisted/test/test_ftp.py -- there's a testStor method in there

...well, there was.  Hmm.  CVS to the rescue:

Jonathan -- what happened to testStor?


More information about the Twisted-Python mailing list