curl-users
RE: multiple upload syntax?
Date: Thu, 21 Aug 2003 15:20:42 +0200 (CEST)
On Wed, 20 Aug 2003, Rich Gray wrote:
> Seems to me that there is a general set of parser rules
> which would support:
>
> A) curl -T file1 -T file2 ftp://site.com/
> B) curl -T file1 ftp://site1.com/ -T file2 ftp://site2.com/
> C) curl -T {file1,file2} ftp://site.com/ -T {file3,file4} \
> ftp://site2.com/
> and even
>
> D) curl -T files(s) site1 site2 site3 \
> -T file(s) -T file(s) siteA siteB
>
> Option D would allow one to transfer sets of files to multiple sites.
>
> Parse rules:
>
> 1. Add any -T files to the upload files list.
>
> 2. When a URL is encountered, designate the upload files
> list to be transfered to that target site. Mulitple
> URLs will simply get the same upload list.
>
> 3. When a -T is encountered after a URL, clear the upload files
> list so we can start over. (Or do it explicitly with
> -T "" to allow the files list to grow.)
Options A+D and these rules break the currently used position-agnostic
approach. Today, people might already be uploading single files like this:
curl URL -T FILE
or downloading multiple files like this:
curl URL1 URL2 -o FILE1 -o FILE2
Which might make it strange to all of a sudden require that you specify the -T
option(s) before a given URL.
Also, when there's HTTP involved, each upload may in fact have their own
output so it would require this same approach go for -o.
I think I'm in favour of leaving it working like this:
* One -T for each URL.
* -T "" makes no upload to the URL, only download
* Each -T can specify multiple files using the already provided globbing
system, like in -T {first,second}
If you want to upload multiple files to the same URL, then it isn't that hard
to just repeat the URL once for each -T, as in:
curl -T file1 -T file2 -T file3 URL URL URL
This is how the current CVS version works.
> Error recovery could be a pain with long lists.
Yes it is. We have no particular support for that today, but if one of the
transfers break somehow, the whole operation is aborted.
> Perhaps a way out of that would be to have an option to have curl write an
> error recovery file which would simply be a command line to transfer any
> untransfered files and/or one to transfer any untransfered files besides the
> current failing transfer.
That's a cool idea indeed, but I think I'll save implementing that for one of
those dark and cold winter days we can have up here... :-)
-- Daniel Stenberg -- curl: been grokking URLs since 1998 ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0Received on 2003-08-22