public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* 回复:Re: Running 'curl' with '-o' option failed with error "curl: (23) Failed writing body (0 != 720)"
@ 2019-06-21  7:40 Ma Hao
  2019-06-21 20:36 ` Brian Inglis
  0 siblings, 1 reply; 2+ messages in thread
From: Ma Hao @ 2019-06-21  7:40 UTC (permalink / raw)
  To: Csaba Raduly, cygwin

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain;	charset=GBK, Size: 1709 bytes --]

Thanks for pointing that out.Appreciate your quick responding.

--------------------------------

Ma HaoBR
email: mahao_boy@sina.cn
Phone: +86(0)13981759428
Location: Tianfu Software Park, Tianfu avenue, High Tech Zone, Chengdu, Sichuan Province, China


----- ԭʼÓʼþ -----
·¢¼þÈË£ºCsaba Raduly <rcsaba@gmail.com>
ÊÕ¼þÈË£ºmahao_boy@sina.cn, cygwin list <cygwin@cygwin.com>
Ö÷Ì⣺Re: Running 'curl' with '-o' option failed with error "curl: (23) Failed writing body (0 != 720)"
ÈÕÆÚ£º2019Äê06ÔÂ21ÈÕ 15µã37·Ö


Hi,
On Fri, Jun 21, 2019 at 9:28 AM Ma Hao <mahao_boy@sina.cn> wrote:
>
> Hi,
> 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.
Csaba
-- 
You can get very substantial performance improvements
by not doing the right thing. - Scott Meyers, An Effective C++11/14 Sampler
So if you're looking for a completely portable, 100% standards-conformat way
to get the wrong information: this is what you want. - Scott Meyers (C++TDaWYK)
\x03B‹KCB”\x1c›Ø›\x19[H\x1c™\^[ܝ\x1cΈ\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÜ\x1c›Ø›\x19[\Ëš\x1d^[[\x03B‘TNˆ\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÙ˜\KÃB‘^[ØÝ[Y[\x18]\x1a[ÛŽˆ\b\b\b\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÙ^[ØÜËš\x1d^[[\x03B•[œÝXœØÜšX™H\x1a[™›Îˆ\b\b\b\b\b\x1a\x1d\x1d\x1c\x0e‹ËØÞYÝÚ[‹˜ÛÛKÛ[\vÈÝ[œÝXœØÜšX™K\Ú[\^[\x19CBƒB

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Running 'curl' with '-o' option failed with error "curl: (23) Failed writing body (0 != 720)"
  2019-06-21  7:40 回复:Re: Running 'curl' with '-o' option failed with error "curl: (23) Failed writing body (0 != 720)" Ma Hao
@ 2019-06-21 20:36 ` Brian Inglis
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Inglis @ 2019-06-21 20:36 UTC (permalink / raw)
  To: cygwin

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-21 20:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-21  7:40 回复:Re: Running 'curl' with '-o' option failed with error "curl: (23) Failed writing body (0 != 720)" Ma Hao
2019-06-21 20:36 ` Brian Inglis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).