cURL
Haxx ad
libcurl

curl's project page on SourceForge.net

Sponsors:
Haxx

cURL > Mailing List > Monthly Index > Single Mail

curl-users Mailing List Archives

Patch for binary stdout on win32

From: Björn Stenberg <bjorn_at_haxx.se>
Date: Tue, 13 Jun 2000 20:30:50 +0200 (CEST)

Here's a patch for 6.5.2 to set stdout to binary mode on win32 systems.
Default on windows is text mode, which today results in corrupted data when
you curl binary data and pipe it to another program.

src\main.c:

69a70,73
> #ifdef HAVE_FCNTL_H
> #include <fcntl.h>
> #endif
>
887a892,897
> #endif
> #ifdef WIN32
> /* 20000613 bjst
> * Set stdout to binary mode
> */
> setmode( 1, O_BINARY );

With this fix, I can now curl a shoutcast stream and pipe it directly to a
player. Many players don't include very advanced proxy support, so being able
to curl the stream makes the difference between silence and rock'n roll! :-)

-- 
Björn Stenberg
mailto:bjorn_at_haxx.se
http://bjorn.haxx.se
Received on 2000-06-13

These mail archives are generated by hypermail.

donate! Page updated November 12, 2010.
web site info

File upload with ASP.NET