delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2019/06/21/16:37:28

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; q=dns; s=default; b=VvdH5nvPqqAnxU8F
+0X9YXBU3TPaB3cuKc5fIwrKgCMrg5kjz+lIXkFgS956JRAQsc1Qmv6+/0MZPNO5
+2Uc3NLrh5ldnWSM72BXbenBlMJADgvFEUrlt2rJfvSe29UfvNGbnAHwosoOD3bj
gzRFTP1LcWI7CRMEl2TpmQAfC8w=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:reply-to:subject:to:references:from:message-id
:date:mime-version:in-reply-to:content-type
:content-transfer-encoding; s=default; bh=IwKTJmRme1rlsmbHmBY+eG
V9rdQ=; b=BmzRSLydIEZ/nj6QiSJB0q51s5dbaIFNbtQqbtWg3PdtrgJo8ndSTN
rdnLPeUOaVO+EFI8Fu1nl8pAsVi0TQJglXOb7HJ2CbZ8T9FpDSCznv6t/XoJROVs
SrDG1ZiMiKAGqzv5TyJjp3I1TiuWu8tGfutqxcC0Aja9Ke8REX0Zg=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Spam-SWARE-Status: =?ISO-8859-1?Q?No, score=-2.0 required=5.0 tests=AWL,BAYES_20,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 spammy=2019=e5=b9=b406=e6, disturbing, operate, Csaba?=
X-HELO: smtp-out-so.shaw.ca
Reply-To: Brian DOT Inglis AT SystematicSw DOT ab DOT ca
Subject: Re: Running 'curl' with '-o' option failed with error "curl: (23) Failed writing body (0 != 720)"
To: cygwin AT cygwin DOT com
References: <20190621074049 DOT 8D3DF4140097 AT webmail DOT sinamail DOT sina DOT com DOT cn>
From: Brian Inglis <Brian DOT Inglis AT SystematicSw DOT ab DOT ca>
Openpgp: preference=signencrypt
Message-ID: <640e0c54-8231-a05d-e145-eb2dd1b01a3b@SystematicSw.ab.ca>
Date: Fri, 21 Jun 2019 14:36:33 -0600
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2
MIME-Version: 1.0
In-Reply-To: <20190621074049.8D3DF4140097@webmail.sinamail.sina.com.cn>
X-IsSubscribed: yes

On 2019-06-21 01:40, Ma Hao wrote:
> On 2019年06月21日 15点37分, Csaba Raduly wrote: 
>> On Fri, Jun 21, 2019 at 9:28 AM Ma Hao wrote:
>>> I was running into the problem when I tried to download spring:
>>> $ curl https://codeload.github.com/spring-projects/spring-framework/zip/master -o /home/cdmahao/
>> You told curl to write the download to a file named /home/cdmahao/
>> Unfortunately, there is already a directory named /home/cdmahao/, and
>> curl can't write a file to a directory.
>> You need to give the name of a file to -o
>> $ curl https://codeload.github.com/spring-projects/spring-framework/zip/master
>> -o /home/cdmahao/master.zip
>> curl works differently from wget. wget invents a filename based on the
>> URL. curl does not do that.
> Thanks for pointing that out.Appreciate your quick responding.

To make curl operate more like wget when downloading files, use curl -JOR where:

-O,--remote-name uses the trailing URL component as the filename to save;

-J,--remote-header-name works with -O,--remote-name to use the server
Content-Disposition header filename if available, instead of the trailing URL
component, as the filename to save;

-R,--remote-time is like wget -N,--timestamping and uses the remote file
modified time stamp if available;

--remote-name-all enables -O for all URLs specified in the command.

Note that curl will only download into the current directory and never
overwrites existing files, whereas wget supports -P,--directory-prefix=prefix,
and wget requires -nc,--no-clobber to suppress version suffixing the file names
of, or overwriting, existing files depending on other options specified.

-- 
Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019