cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: SFTP - How to delete a file

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 27 Aug 2007 22:27:21 -0700

On Mon, Aug 27, 2007 at 11:57:51PM -0500, Mathew Simon wrote:
> I tried both the CURLOPT_QUOTE AND POSTQUOTE. But both are failing
> however way I tried to form the "rm" command.
>
> This is my situation.
> SFTP url= sftp://xxx.xxx.com/ReceiveFiles/filename1.txt
>
> I am able to download this file. But I am unable to delete this file
> using either CURLOPT_QUOTE or POSTQUOTE. If I use CURLOPT_QUOTE, most of
> the time the download is also failing and I get the verbose output of
> "malformed url" error.
>
> I tried the following combinations
> RM filename1.txt
> RM ReceiveFiles/filename1.txt
> RM /ReceiveFiles/filename1.txt
> RM xxx.xxx.com/ReceiveFiles/filename1.txt
> RM sftp://xxx.xxx.com/ReceiveFiles/filename1.txt
>
> I am not sure which form of the "RM" command I should use. Any
> suggestions?

"rm" takes an absolute path name, so I would have expected the
RM /ReceiveFiles/filename1.txt form to work.

> Also, I tried to give a simple "pwd" command as CURLOPT_POSTQUOTE, and
> this is the only command in the slist. But this is also failing, and the
> verbose output massage talks about giving parameters to the SFTP quote
> command. I have no idea what is happening.

That should also have worked. What version of libcurl are you using? And
what are the exact options and error messages you're seeing? Have you
tried doing the same operations using the curl command-line client to rule
out a problem with your program?

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2007-08-28