cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: Rename using CURL lists files in remote working directory. Want to suppress directory listing

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 9 May 2011 11:20:18 -0700

On Mon, May 09, 2011 at 03:02:07PM +0000, Raghu Udupa wrote:
> We use curl command line tool to copy files to a remote server using ftp and
> SSL.
>
> CURL command is
>
> /usr/bin/curl --config /configdir/curl.cfg --ftp-port - -Q "RNFR tmp/c009.tif"
> -Q "RNTO tmp/cc009.tif.done" -u user:pwd ftp://remoteftpserver.com:21
>
> After each rename, curl command output lists the entire remoter working
> directory.
[...]
> Is there a way to suppress this listing?

curl's purpose is to transfer files; renaming them is really incidental to
it main purpose. It provides the root directory listing corresponding to
the URL given in order to satisfy the primary purpose of the command
invocation. That's a long way of saying, not really, in the general case.
But if you provide the --head option, which skips the data transfer
portion of the request, it turns requests on FTP directory URLs such as
the one you are providing into practically a no-op.

>>> Dan
-------------------------------------------------------------------
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 2011-05-09