Mail Archives: djgpp/2000/07/13/13:00:52
DJ Delorie <dj AT delorie DOT com> wrote:
>> 'text' mode in Unix (nor should there really have been a need to
>> invent it on DOS: absence of 'b' already means "text mode", so what
>> would you need a 't' specifier for?)
> Absence of 'b' means *default*, which can still be binary if you (or
> the application, if you are a library) have set the _fmode variable
> appropriately.
Not by any existing standard definition of the C programming language
or C library functions I've seen. By definition of the language,
absence of 'b' clearly means 'text file', *not* default.
In my not so humble opinion, '_fmode' is one of the silliest things
DOS compilers ever came up with. It may have had its uses back in the
days before ANSI C, but they should have retracted this feature back
in 1990, at the latest. It serves no useful purpose that can't be
achieved by other, standard-conforming ways, too.
> In cygwin, the "default" comes from the mount table, and is often
> "binary", so the "t" is a good idea.
I oppose to this view. The only truly good idea is to fix the programs
on source level. The program author is the only instance that is able
to know for sure if a file is in text format or not, so she can act
accordingly. Trying to do this any other, more global level, like per
filesystem in Cygwin or per program via _fmode, is trying to cure
symptoms instead of the disease. Moreover, the cure is dangerous in
itself: it's a guess, essentially, and will guess wrongly sometimes.
--
Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de)
Even if all the snow were burnt, ashes would remain.
- Raw text -