473,556 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.n lst() 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 4115
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.n lst() 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************ ****@nospamyaho o.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.n lst() to retrieve
the list of filenames. Then iterates through this list with
retrlines('RET R ' + 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
1792
by: Antoine Logean | last post by:
Hi, given this code: from ftplib import FTP connection = FTP('ftp.python.org') connection.login() connection.dir()
5
6886
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", 'w+b') ftp.retrbinary("RETR foo.xml", xml_source.write)
10
2784
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 & claws* Why have I stuck with DW this long? - good website management -- I have 6 or 7 so far, and DW is handy for integrating site...
13
1963
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
9544
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 *' with no success. I am using the following: srcFtp = FTP(srcHost) srcFtp.login(srcUser, srcPass) srcDir = srcFtp.nlst('.')
5
3435
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 start"... Anyone please help...
0
3728
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 without executing the rest of the commands. Is there any sort of switch (or something along those lines) that I can use to get around this? Here's a...
0
1687
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 failures occurring in ftp process how to trace failure files... everything in batch file script only... this is my ftp script ... @ echo off
1
3454
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 just starts again from the first file, going round and round in circles. Any help much appreciated.
0
7547
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7825
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8060
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7588
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7904
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5452
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3596
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2037
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1159
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.