473,387 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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:

http://216.67.238.18/~bar/misc/BetterFTP.py

Beeyah
Jul 18 '05 #1
0 1065

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Kevin Ollivier | last post by:
Hi all, I've come across a problem that has me stumped, and I thought I'd send a message to the gurus to see if this makes sense to anyone else. =) Basically, I'm trying to upload a series of...
0
by: Joshua Burvill | last post by:
Hello, I am trying to print something to a print server using the following function but I get errors, does anyone have any pointers? Rgds, Josh Traceback (most recent call last): File...
2
by: Matija Papec | last post by:
I would like to reimplement ftplib "nlst" using ftplib.dir (ftp server doesn't support nlst) so I'm trying to guess how to use ftp callbacks. Any help is appreciated. tia! ============...
2
by: Harlin Seritt | last post by:
Using ftplib from Python I am trying to get all files in a particular directory using ftplib and then send those same files to another ftp server. I have tried using commands like 'get *' and 'mget...
1
by: Леонов Алексей | last post by:
Hello! I use this code: from ftplib import FTP def handleDownload(block): file.write(block) print "." file = open('1', 'wb') ftp = FTP('ftp.utk.ru')
5
by: John Salerno | last post by:
I'm experimenting with this now and I'm a little confused about transferring commands. This might be more of an FTP question than strictly Python, but it's still related to how to use the ftplib...
3
by: Florian Demmer | last post by:
Hi! I have a number of ftp uploads running in parallel using ftplib.storbinary and threading and in case one of them fails I need to interrupt all the others (but not exit the program...
1
by: Laszlo Nagy | last post by:
Hi All, I'm using a simple program that uploads a file on a remote ftp server. This is an example (not the whole program): def store(self,hostname,username,password,destdir,srcpath):...
1
by: rahultandon | last post by:
hi all, im trying to create an ftp connection to some ftp site using the followin code..but i always get an error in this line : import ftplib ftp =ftplib.FTP("ftp.cwi.nl") .... ... this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.