cURL / Mailing Lists / curl-library / Single Mail


RE: SFTP - How to delete a file

From: Mathew Simon <>
Date: Mon, 27 Aug 2007 12:39:33 -0500

That is a good idea. Thank you!

I may not be able to use the CURLOPT_QUOTE since these actions will take
place even before CWD command, and hence the file to be deleted may not
be reachable. But hopefully I can try the CURLOPT_PREQUTE.

Mathew Simon

-----Original Message-----
[] On Behalf Of Dan Fandrich
Sent: Monday, August 27, 2007 12:01 PM
Subject: Re: SFTP - How to delete a file

On Mon, Aug 27, 2007 at 11:53:09AM -0500, Mathew Simon wrote:
> The decision to delete can be made only after downloading the file,
> and after seeing/verifying the content of the file. Hence, the
> decision to issue CURLOPT_POSTQUOTE cannot be made before the
> download.

Since you are doing many transfers in a loop, you could add
a CURLOPT_QUOTE to delete the previous file on the following file's
download action. For the final file, you will probably need to do a
dummy download of a nonexistent file to force the CURLOPT_QUOTE action
to take place.

>>> Dan

--              The web change of address
          Let webmasters know that your web site has moved
Received on 2007-08-27