Using the ftp lib to rename a file

Henri de Feraudy feraudyh at valise.com
Mon May 28 06:46:07 EDT 2001


Thankyou!

On Sun, 27 May 2001 16:11:53 +0200 you wrote:
>On Sun, May 27, 2001 at 06:35:12AM -0700, Henri de Feraudy wrote:
>
>> Can anyone show me a sample illustrating how I can use the ftp lib
>> from my client station to rename a file on the server?
>> The ftplib doc is a bit minimal.
>
>It's really as minimal as the docs show, though. You connect to an FTP
>server:
>
>  import ftplib
>  conn = ftplib.FTP("my.host.com", "user", "passwd")
>
>And you send the rename command:
>
>  conn.rename("/my/old/name", "/my/new/name")
>
>Don't forget to use fully qualified pathnames, or conn.cwd() to the right
>directory before doing the rename.
>
>-- 
>Thomas Wouters <thomas at xs4all.net>
>
>Hi! I'm a .signature virus! copy me into your .signature file to help me 
spread!




More information about the Python-list mailing list