[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Here documents and CRLF



On Thu, Jun 17, 1999 at 09:37:38PM +0200, Julian Reschke wrote:
> > Yes, but on POSIX systems the "b" is ignored (because there is no
> > difference between text and binary streams).  Does ANSI-C really demand
> 
> Could you please refer me to the relevant part of POSIX that defines that?

My information is only second-hand, sorry.  It is from the glibc manual,
the section on "fopen".

> > that the "b" is recognized?  My understanding was that it is more portable
> > to omit the "b" (and rather let M$-DOGgy systems fail)
> 
> This is certainly wrong. ANSI-C is a proper subset of POSIX, and ANSI-C says
> you *must* use "b" to get a binary string.

I neither have ANSI-C nor POSIX here.  But the glibc manual is usually a
reliable source of information and it says the contrary of you (that
doesn't mean that I don't think it's possible that you are right and the
glibc manual is wrong, I just can't tell).

The relevant part of the manual:

	The character `b' in OPENTYPE has a standard meaning; it
	requests a binary stream rather than a text stream.  But
	this makes no difference in POSIX systems (including the
	GNU system).  ...
	...
	Any other characters in OPENTYPE are simply ignored.  They
	may be meaningful in other systems.

OK, this says that it doesn't hurt to add the `b' and that it is a bug
if the implementation of fopen() would barf out on seeing it.  But you
probably know that the `b' is often omitted in sources for other Unix
systems.

Ciao

Guido
-- 
http://stud.uni-sb.de/~gufl0000
mailto:gufl0000@stud.uni-sb.de