469,645 Members | 1,176 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,645 developers. It's quick & easy.

written improvement on ftplib.FTP(); relevant questions

in my inability to find a working ftp program for my mac, i decided to
write one in python. i wrote a class (link at end of post) that
inherited ftplib.FTP and made the process slightly less involved, but
it brought up a few questions:

using the sendcmd() method to do a simple "LIST" command returns an
error explaining that a data connection could not be opened, just as
if you connected to a ftp server using telnet. so, you use the method
retrlines() with "LIST", and everything's fine. the whole module, in
my opinion, seems like a piece of work. every method gives the
appearance of a workaround. i get the impression it would be
enormously easier to manipulate and comprehend if you simply wrote it
on your own with sockets.

so what i'm saying is i want to write my own ftp class, but i don't
know how to handle the two seperate data/command sockets. i started to
read the rfc, but i'm so sick of those things lately. if it isn't a
simple explanation, could someone point me to an appropriate document,
or the relevant page of the rfc, that will explain the process of the
command connection versus the data connection in general programatic
terms? I'd appreciate that.

anyway, if anyone's interested, i'll link to the class i wrote. it
uses a queue to store messages from the server and general program
messages, with the intention of having a seperate thread to sit and
interpret/output. in addition, the class is intentionally completely
detached from the fate of the program, that way it could be more
universal. with that in mind, when something fatal involving the
connection has occured, it pushes a simple "exit" string to the queue
-- one that could be changed to a numeric representation of an error
message or whatever, to be "interpreted" so to speak. its right here:

Jul 18 '05 #1
0 940

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Kevin Ollivier | last post: by
reply views Thread by Joshua Burvill | last post: by
2 posts views Thread by Matija Papec | last post: by
2 posts views Thread by Harlin Seritt | last post: by
1 post views Thread by Леонов Алексей | last post: by
5 posts views Thread by John Salerno | last post: by
3 posts views Thread by Florian Demmer | last post: by
1 post views Thread by Laszlo Nagy | last post: by
1 post views Thread by rahultandon | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.