This is the mail archive of the
mailing list for the libstdc++ project.
Re: Should basic_filebuf rely on posix behavior (on Windows)?
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Kai Tietz <ktietz at redhat dot com>
- Cc: Luke Allardyce <lukeallardyce at gmail dot com>, libstdc++ at gcc dot gnu dot org
- Date: Mon, 24 Nov 2014 17:15:14 +0000
- Subject: Re: Should basic_filebuf rely on posix behavior (on Windows)?
- Authentication-results: sourceware.org; auth=none
- References: <CAFW6PZCYq826MAA7vqUB16C43269vLGJ8PsSN4GYHHgbErR9Jg at mail dot gmail dot com> <20141124113711 dot GD5191 at redhat dot com> <1910959279 dot 17257508 dot 1416846177507 dot JavaMail dot zimbra at redhat dot com>
On 24/11/14 11:22 -0500, Kai Tietz wrote:
We might consider to use here binary-mode as default for Windows systems. But your sentence I can follow.
I think that would require libstdc++ to do the line-ending conversions
I would suggest to use here instead of just 'std::ios::in' additionally the binary-mode-flag 'std::ios::in | std::ios::binary'. I tested your sample, and it works nicely.
Yes, but iostreams are supposed to be usable in text mode and perform
line-ending conversions, like stdio does. Just not using text mode
dodges the problem but doesn't solve it :-)