Re: ftplib question (cannot open data connection)

2008-01-13 Thread Laszlo Nagy
> BUT: active FTP does not just send the data to the port that was in > the random port that was sent to the server... it addresses to the port > you sent, but it sends its data response FROM port 20. This means the > response looks like a totally unsolicited connection attempt from the > ou

ftplib question (cannot open data connection)

2008-01-11 Thread Laszlo Nagy
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): self.ftp = ftplib.FTP(hostname) self.ftp.login(username,password) self.ftp.set_pasv(False) se

Re: ftplib question

2006-04-07 Thread RunLevelZero
Well I am not too familiar with ftplib but I have done some minimal work. Example: try: server=FTP() server.connect('ftp.mcafee.com', 21) except: print "Could not connect to server" raw_input("Hit Enter to quit:") sys.exit(0) login = server.login('anonymous', '[EMAIL PROTEC

ftplib question

2006-04-07 Thread eight02645999
hi my purpose is just to connect to an FTP server and delete all files in a directory Is there a way using ftplib module? something like ftp.delete("*") ? another way i can do is using LIST to list out all the files in that directory, grab the filename, append to an array, then do a for loop to del

Re: ftplib question - ftp.dir() returns something and ftp.nlst() does not

2005-11-25 Thread Nico Grubert
> it's not obvious how Python could translate '' to anything other > than an empty list, so it sure looks like a server issue. > (or is a problem with running in passive mode? can you test with- > out using passive mode on the same server?) I thought using "ftp.set_pasv(0)" sets active mode

Re: ftplib question - ftp.dir() returns something and ftp.nlst() does not

2005-11-25 Thread Fredrik Lundh
Nico Grubert wrote: > *cmd* 'NLST' > *put* 'NLST\r\n' > *get* '150 About to open data connection.\r\n' > *resp* '150 About to open data connection.' > *retr* '' > *get* '226 Transfer complete.\r\n' > *resp* '226 Transfer complete.' > [] > >>> it's not obvious how Python could translate '' to any

Re: ftplib question - ftp.dir() returns something and ftp.nlst() does not

2005-11-25 Thread Nico Grubert
> add > > ftp.set_debuglevel(3) > > so you can see what the goes on the wire (without that information, it's hard > to tell if it's a bug in the library or a glitch in your server). > > Hello Fredrik , thank you for your reply. I did a "ftp.set_debuglevel(3)" and ftp.nlst() now prints:

Re: ftplib question - ftp.dir() returns something and ftp.nlst() does not

2005-11-24 Thread Fredrik Lundh
Nico Grubert wrote: > I am using the ftplib library to connect to a ftp server. > After I got connected, I can see a list of file in the current directory > using ftp.dir() or ftp.retrlines('LIST'). But using ftp.nlst() returns > an empty list which seems somehow strange to me. Here is, what I did

ftplib question - ftp.dir() returns something and ftp.nlst() does not

2005-11-24 Thread Nico Grubert
Hi there, I am using the ftplib library to connect to a ftp server. After I got connected, I can see a list of file in the current directory using ftp.dir() or ftp.retrlines('LIST'). But using ftp.nlst() returns an empty list which seems somehow strange to me. Here is, what I did: >>> from ftp