cURL / Mailing Lists / curl-users / Single Mail

curl-users

RE: curl: (79) scp: /test.txt: No such file or directory

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Tue, 29 Jun 2010 20:28:24 +0200 (CEST)

On Tue, 29 Jun 2010, Doug McNutt wrote:

>> However, the code within libcurl that does the ~ expansion is different for
>> SCP and SFTP although it isn't at all clear to me WHY this is the case. If
>> you (can) build your own curl from source, it would be fun to see if you
>> can modify lib/ssh.c:ssh_getworkingpath() to use the SFTP approach even for
>> SCP to check if that makes it work for you.
>
> Please remember that the tilde character IS legitimate in (or as) a file
> name. I think, but can't prove, that the tilde convention for one's home
> directory is supposed to be supported only by shells. Quoting is pretty much
> expected to be painful in shells but it ought not to be in tools like curl.

The SCP and SFTP URI syntax actually have the ~ as a special meaning defined
in the spec ("An implementation MAY use the tilde ("~") character as the first
path element in the path to denote a path relative to the user's home
directory." see
http://tools.ietf.org/html/draft-ietf-secsh-scp-sftp-ssh-uri-04#section-4.4),
so we're not making that one up. We're trying to do the right thing...

-- 
  / daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ:        http://curl.haxx.se/docs/faq.html
Etiquette:  http://curl.haxx.se/mail/etiquette.html
Received on 2010-06-29