delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/07/13/13:00:52

From: Hans-Bernhard Broeker <broeker AT physik DOT rwth-aachen DOT de>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Pipe to sendmail (again)
Date: 13 Jul 2000 14:43:21 GMT
Organization: Aachen University of Technology (RWTH)
Lines: 33
Message-ID: <8kkki9$gcv$1@nets3.rz.RWTH-Aachen.DE>
References: <yG3a5.322335$k22 DOT 1427482 AT flipper> <56ga5.329089$k22 DOT 1448044 AT flipper> <8kcu4s$juv$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE> <200007130406 DOT AAA24310 AT envy DOT delorie DOT com>
NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de
X-Trace: nets3.rz.RWTH-Aachen.DE 963499401 16799 137.226.32.75 (13 Jul 2000 14:43:21 GMT)
X-Complaints-To: abuse AT rwth-aachen DOT de
NNTP-Posting-Date: 13 Jul 2000 14:43:21 GMT
Originator: broeker@
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019