cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: SFTP - How to delete a file

From: Mathew Simon <msimon_at_simdol.com>
Date: Thu, 30 Aug 2007 14:13:00 -0500

You are incredible! I answered every question you asked. If you wanted
to see the exact code, you should have asked for it in the first place
and all these past messages (and time) could have been saved. What is
the point in sending all these emails? Trying to help or trying to make
fun, or trying to defend the malfunctioning code by all means? I am not
sure this is the way to help someone seeking help.

The Curl command line is given below. I am manually typing it in my
email since there is no mail facilities on the testing machine.

The following two line displays the root directory list as a console
output (stdout or stderr). The only difference is the slash at the end
and both are producing the directory listing.
curl sftp://xxx.xxx.com --user xxx:pass
curl sftp://xxx.xxx.com/ --user xxx:pass

The following line do not produce any outputs, no error also.
curl sftp://xxx.xxx.com/ReceiveFiles --user xxx:pass

The following line produce the directory listing of "ReceiveFiles".
curl sftp://xxx.xxx.com/ReceiveFiles/ --user xxx:pass

The following line downloads the "test2.txt" file and displays it on the
console (stdout or stderr). Since this is working, this command line is
the basis for all the QUOTE related tests.
curl sftp://xxx.xxx.com/ReceiveFiles/test2.txt --user xxx:pass

The following line gives error, as expected, Curl: (78) Could not open
directory for reading.
curl sftp://xxx.xxx.com/ReceiveFiles/test2.txt/ --user xxx:pass

The following gives error. Curl: (21) Syntax error in SFTP command.
Supply parameters(s).
curl sftp://xxx.xxx.com/ReceiveFiles/test2.txt --user xxx:pass --quote
pwd
curl sftp://xxx.xxx.com/ReceiveFiles/test2.txt --user xxx:pass --quote
'pwd'
curl sftp://xxx.xxx.com/ReceiveFiles/test2.txt --user xxx:pass --quote
'rm'
curl sftp://xxx.xxx.com/ReceiveFiles/test2.txt --user xxx:pass --quote
'heaven'
curl sftp://xxx.xxx.com/ReceiveFiles/test2.txt --user xxx:pass --quote
heaven

The following commands gives two errors.
curl: (21) Syntax error in SFTP command. Supply parameters(s).
curl: (3) <url> malformed

curl sftp://xxx.xxx.com/ReceiveFiles/test2.txt --user xxx:pass --quote
'rm /ReceiveFiles/test2.txt'
curl sftp://xxx.xxx.com/ReceiveFiles/test2.txt --user xxx:pass --quote
rm /ReceiveFiles/test2.txt

The following commands gives two errors.
curl: (21) Syntax error in SFTP command. Supply parameters(s).
curl: (6) Could not resolve hots: 'test2.txt'; no data record of
requested type
curl sftp://xxx.xxx.com/ReceiveFiles/test2.txt --user xxx:pass --quote
rm 'test2.txt'
curl sftp://xxx.xxx.com/ReceiveFiles/test2.txt --user xxx:pass --quote
'rm test2.txt'

I hope that this much is sufficient.

Thanks,
Mathew Simon

-----Original Message-----
From: curl-library-bounces_at_cool.haxx.se
[mailto:curl-library-bounces_at_cool.haxx.se] On Behalf Of Dan Fandrich
Sent: Thursday, August 30, 2007 12:39 PM
To: curl-library_at_cool.haxx.se
Subject: Re: SFTP - How to delete a file

On Thu, Aug 30, 2007 at 11:17:06AM -0500, Mathew Simon wrote:
> The syntax of the quote command do not matter. Give any non-empty
> string as a quote command, whether valid or not, it gives the same
> error message. I tried the "pwd" command, which is broken according to

> you, and also the following flavors of the delete command. In my case
> the files of interest are in the "ReceiveFiles" directory which is at
> the root level (/ReceiveFiles).
>
> > 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

So far in this thread you haven't given any actual command lines or
actual code that is failing--it's all been vague descriptions. So,
don't be too disappointed by the vague answers you're getting.

BTW, have you tried using lower case commands (as documented)? It
should be case insensitive, but maybe something is weird on your
platform.

>>> Dan

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