[Zope] ZServerFTP -- here's the code

Robin Dunn robin@alldunn.com
Sat, 27 Feb 1999 15:27:25 -0800


Thanks.  That did the trick.  HomeSite is still a bit quirky on FTP with
ZServer, but it works in general.

--
Robin Dunn
robin@AllDunn.com
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!
Try http://AllDunn.com/laughworks/ for a good laugh.


-----Original Message-----
From: Brad Clements <bkc@murkworks.com>
To: Amos Latteier <amos@aracnet.com>
Cc: zope@zope.org <zope@zope.org>
Date: Saturday, February 27, 1999 1:19 PM
Subject: Re: [Zope] ZServerFTP -- here's the code


On 27 Feb 99, at 13:32, Amos Latteier wrote:

> At 12:27 AM 2/27/99 -0800, you wrote:
> >HomeSite's FTP mode is apparently trying to use the FTP commands "MODE S"
> >and "STRU F" to which ZServer is responding with a "500 '%s': command not
> >understood." % command and then HomeSite bails out and never fetches any
> >directory listings or anything.
> >
> >Is there any intent to support these commands?  It sure would be nice.
>
> Right now we are trying not to add a lot of FTP commands to ZServer that
> Medusa's FTP server doesn't already support, and it seems that Medusa
> doesn't support these right now.
>
> I'll look into these commands and if they are easy to implement and make
> sense for Zope, I'll try. Of course, patches are always welcome.
>


FYI, these can be treated as NOOPs and just ack em with a 200 code.

MODE S  (stream) is the default anyway
STRU F (file) is also the default.

See ... streaming file of bytes == default FTP mode anyway.

Accept mode, if it's == S return 200 OK, else 500 not implemented.

In fact, here's the code for ftp_server.py

def cmd_stru (self, line):
'specify file structure'
# only F supported
t = string.lower (line[1])
if t <> 'f':
self.command_not_understood (string.join (line))
else:
self.respond ('200 STRU set to %s.' % t)

def cmd_mode (self, line):
'specify file mode'
# only S supported
t = string.lower (line[1])
if t <> 's':
self.command_not_understood (string.join (line))
else:
self.respond ('200 mode set to %s.' % t)

Add around line 329.. Tested and approved.. ;-)



Brad Clements,                bkc@murkworks.com   (315)268-1000
http://www.murkworks.com                          (315)268-9812 Fax
netmeeting: ils://ils.murkworks.com               ICQ: 14856937

_______________________________________________
Zope maillist  -  Zope@zope.org
http://www.zope.org/mailman/listinfo/zope