[Twisted-Python] Implementing a custom FTP server

Jason Stitt jason at pengale.com
Sun Sep 5 23:02:30 MDT 2004


Hi, all,

I'm trying to implement a custom FTP server (eventually SFTP, but I 
want to get the basics down.) It won't operate on the file system; the 
back end will be a database, and the server will generate virtual 
directories and folders on the fly.

I have a basic Twisted-based FTP server running. I can log in, and I 
have successfully overridden ftp_LIST to display a custom "file" list.

I have gotten stuck on ftp_STOR and ftp_RETR. There is no 
implementation of ftp_STOR in the base FTP class, so I have no 
reference to work against, and I am also having a hard time figuring 
out how ftp_RETR works. How or where is the actual file data passed 
back and forth?

Any pointers would be greatly appreciated.

Thanks,

Jason

P.S. A lack of documentation aside, though, Twisted has been quite easy 
to work with so far. Even fun :)

P.P.S. is SFTP different enough from FTP that I should be thinking 
about implementing it from the start, rather than later, or can I just 
graft an SSL layer onto my FTP server?





More information about the Twisted-Python mailing list