cURL / Mailing Lists / curl-library / Single Mail

curl-library

Curl sftp question...

From: Joe Ebmeier <ebmeierj_at_iivip.com>
Date: Tue, 26 Jun 2007 09:06:02 -0500

Hi,

    We are currently upgrading our version of curl to get sftp support for a
.c program we use to move files around. I have tried using sftp from the .c
program (using the curl libraries) and from the command line with the same
results. With regular ftp, we were setting the "CURLOPT_FTPLISTONLY" flag
(same as using a -l or --list-only from the command line) so we could use a
wildcard to specify a file prefix. Sftp appears to be different in
functionality, however, and I am having trouble finding helpful
documentation. When I execute the same code with sftp, the command returns
nothing. (If I get rid of the -l option on the command line, it lists the
directory contents of the directory I was expecting.) If I use a wildcard,
I get a message stating the file or directory does not exist. I just
upgraded to curl version 7.16.3 yesterday and I am still having the same
problems.

 

Here is an example of what I was doing from the command line:

  When I execute:

    curl -l -u interact:password ftp://javadev2.interact.nonreg/lib/

  I get:

    libiicore.so

 

  When I execute:

    curl -l -u interact:password
sftp://javadev2.interact.nonreg/interact/lib/

  I get nothing, but have a 0 return from curl.

 

  But when I execute:

    curl -u interact:password sftp://javadev2.interact.nonreg/interact/lib/

  I get:

    drwxr-xr-x 1 0 0 4096 Jun 7 9:52 .

    drwxr-xr-x 1 0 0 4096 Jun 7 9:52 ..

    -rwxrwxrwx 1 0 0 572486 Jun 7 9:54 libiicore.so

 

  Note: It appears that sftp wants the absolute path while ftp wants the
path relative to the user's home directory. That is why the first command
only has /lib/ while the next two have /interact/lib/.

 

So I guess I have these questions:

 1.) Is there sftp specific documentation that might be able to help me?

 

2.) Any idea how to list the contents of a directory
(using wildcards) with sftp?

 

3.) If this functionality is not currently supported, any
idea when it might be?

 

Joe Ebmeier

Interact Incorporated

(402) 476-8786 x357

ebmeierj_at_iivip.com

 
Received on 2007-06-26