473,396 Members | 1,970 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,396 software developers and data experts.

ftp mget

Anybody know if there's an ftp client in python that can do an mget?

My current implementation of an mget uses ftpconnection.nlst() to retrieve
the list of filenames. Then iterates through this list with
retrlines('RETR ' + fname,callback).

I'd like to eliminate a LIST command on the ftp server altogether.

Thanks to all.

Allan
Jul 18 '05 #1
2 4102
On Thu, 2004-03-25 at 18:54, allanc wrote:
Anybody know if there's an ftp client in python that can do an mget?

My current implementation of an mget uses ftpconnection.nlst() to retrieve
the list of filenames. Then iterates through this list with
retrlines('RETR ' + fname,callback).

I'd like to eliminate a LIST command on the ftp server altogether.

Thanks to all.

You may want to look in the python distribution at the script
Tools/scripts/ftpmirror.py. It's referenced on the module documentation
page for ftplib.
It basically does what you're doing - parsing text returned by the LIST
command. It will probably give you some ideas, or let you know whether
you're barking up the wrong tree.

Rich

Jul 18 '05 #2
allanc <al****************@nospamyahoo.com> writes:
Anybody know if there's an ftp client in python that can do an mget? My current implementation of an mget uses ftpconnection.nlst() to retrieve
the list of filenames. Then iterates through this list with
retrlines('RETR ' + fname,callback). I'd like to eliminate a LIST command on the ftp server altogether.


A quick scan of the FTP RFC at:

http://www.w3.org/Protocols/rfc959/Overview.html

(specifically "file transfer functions") suggests that there is no command to
get multiple files by globbing and that you have to do it this way.

Eddie
Jul 18 '05 #3

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

Similar topics

4
by: Antoine Logean | last post by:
Hi, given this code: from ftplib import FTP connection = FTP('ftp.python.org') connection.login() connection.dir()
5
by: Richard Lewis | last post by:
Hi there, I'm having a problem with unicode files and ftplib (using Python 2.3.5). I've got this code: xml_source = codecs.open("foo.xml", 'w+b', "utf8") #xml_source = file("foo.xml",...
10
by: Mary Ellen Curtin | last post by:
arrgh. Because I can't afford a new system right now, I'm running a hamster-powered Pentium 166, 64 M RAM, Win 95. I've been using Dreamweaver3, but I've now reached my limit. *rends DW3 with teeth...
13
by: Murali | last post by:
Given: L = list of integers. X and Y are integers. Problem: find every occurence of X and replace with Y Solution1: def check(s): if s==X: return Y else return s newL =
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...
5
by: msivamani | last post by:
I have written a batch file for ftp ing some log files from unix server... and scheduled it to run every day using Windows Scheduler... But when i see the next day the status will be "Could not...
0
by: stang501 | last post by:
I have an sftp batch file that has a few lines with mget's. The problem I am having is that when the mget command does not find any file that matches the pattern, it kicks me out of the script...
0
by: vasikaran | last post by:
Hi , i hava one ftp script in batch file programming , ftp script is working fine.. but my is i dont know how much files and what are files avaiulable in remote folder ,,,, if any errors or...
1
by: firehose | last post by:
Hi, I'm using the mget command to retrieve multiple files from a remote server. I'm finding that once all the files have been retrieved the process doesn't end and return me to the ftp prompt it...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: 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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.