cURL / Mailing Lists / curl-users / Single Mail


Patch for binary stdout on win32

From: Björn Stenberg <>
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.


> #ifdef HAVE_FCNTL_H
> #include <fcntl.h>
> #endif
> #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
Received on 2000-06-13