Re: Help - I'm at wit's end...

From: Phil Carmody (thefatphil_demunged_at_yahoo.co.uk)
Date: 12/30/04


Date: 30 Dec 2004 04:45:08 +0200

BRG <brg@nowhere.org> writes:

> Mike Scott wrote:
> > Actually its best to explicitly use "rt" or "rb" (t for text, b for
> > binary).
> > Use of "r" on its own is ambiguous - and the results depend on the compiler
> > defaults. Most interpret "r" as "rt", but I am aware of at least one C
> > compiler which interprets "r" as "rb".
>
> Interesting - I was not aware that a 't' option existed - is this an
> ANSI designated file opening mode?

Yes! <grin> It's designated as undefined behaviour!

Only a string matching (perl regexp) /[rwa](b\+?|\+b?)?/ is not UB.

> Is it widely recognised (or silently ignored where it is unecessary)?

Last time I tried it Scott Nudds flew out of my nose. But I'm unlucky like that.

Phil

-- 
The gun is good. The penis is evil... Go forth and kill.