cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Problems with Http download under windows

From: Tor Arntsen <tor_at_spacetec.no>
Date: Tue, 1 Jul 2008 12:30:39 +0200

On Mon, Jun 30, 2008 at 7:32 PM, Loic Quertenmont <loicus_at_gmail.com> wrote:
> I have just found the error
>
> FILE * fp = fopen(out_file, "w");
> -->
> FILE * fp = fopen(out_file, "wb");
>
> Because we are working with binary files and not txt file.
> the strange thing is that it works perfectly under linux (strange strange ;) )

That's because under Windows 'w' is used for text files while 'wb' is
used for binary files. On Linux (or any *nix) there's no difference
between a text file and a binary file, so w == wb.
Received on 2008-07-01