curl-and-python

Re: Using pycurl.QUOTE to delete files

From: Kjetil Jacobsen <kjetilja_at_gmail.com>
Date: Thu, 24 Aug 2006 09:28:20 +0200

hi,

the QUOTE option takes a python list of raw ftp commands.

example:
"""
import pycurl
c = pycurl.Curl()
c.setopt(c.URL, 'ftp://ftp.sunet.se/')
c.setopt(c.FTP_USE_EPSV, 1)
c.setopt(c.QUOTE, ['cwd pub', 'type i'])
c.perform()
c.close()
"""

this example does not do anything interesting but gives the general
approach (you may not need to enable passive mode if you are not
behind a firewall) - if i remember correctly, you have to use the
'DELE' ftp command to delete a file.

regards,
    - kjetil

On 8/23/06, Winslow, Dave - OJA <Dave.Winslow_at_wisconsin.gov> wrote:
>
>
>
>
> Can anyone give a small python example of how to use "pycurl"
>
> to delete files from an FTP server? I'm not sure how to use
>
> pycurl.QUOTE to do this.
>
>
>
> Thanks,
>
>
>
> Dave.
>
>
> _______________________________________________
> http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
>
>
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2006-08-24