Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Renaming files in ftplib

Reply
Thread Tools

Renaming files in ftplib

 
 
Thierry Lam
Guest
Posts: n/a
 
      01-06-2006
Let's say I have a file called 'test.c' on my local machine and I'm
ftping a file with similar name from a remote computer. I want to
prefix the file ftped over with a T_, how do I do that through ftplib
in python?

Thanks
Thierry

 
Reply With Quote
 
 
 
 
wittempj@hotmail.com
Guest
Posts: n/a
 
      01-08-2006
Do for instance:
Step 1. Move the file to another directory from the remote computer -
see http://docs.python.org/lib/ftp-objects.html
Step 2. Rename the file here. See
http://docs.python.org/lib/os-file-dir.html, function rename
Step 3. Move the file to the desired directory, use the same function

 
Reply With Quote
 
 
 
 
wittempj@hotmail.com
Guest
Posts: n/a
 
      01-08-2006
how to get files: http://docs.python.org/lib/ftp-objects.html, see
function retrlines for a textfile
how to rename files: mhttp://docs.python.org/lib/os-file-dir.htmlv,
function rename

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: ftplib and retrbinary or retrlines (losing newlinecharacters in my log files) Gabriel Genellina Python 0 01-25-2007 06:28 AM
Problem with FTPLib and incomplete files on some downloads Peter A. Schott Python 1 01-18-2006 07:50 AM
ftplib - issues with some files not completing? Peter A. Schott Python 0 08-23-2005 10:14 PM
FTPLIB - retry files? Peter A. Schott Python 2 01-19-2005 07:34 PM
ftplib question: how to upload files? python@sarcastic-horse.com Python 3 09-12-2003 11:48 AM



Advertisments