Newsgroups: comp.lang.c
Path: utzoo!henry
From: henry@zoo.toronto.edu (Henry Spencer)
Subject: Re: redirecting output
Message-ID: <1990Jul3.171151.6137@zoo.toronto.edu>
Organization: U of Toronto Zoology
References: <22931@dartvax.Dartmouth.EDU> <JASON.90Jun28152010@oswine.cs.odu.edu> <1990Jun29.172429.2818@zoo.toronto.edu> <JID4B=4@ficc.ferranti.com>
Date: Tue, 3 Jul 90 17:11:51 GMT

In article <JID4B=4@ficc.ferranti.com> peter@ficc.ferranti.com (Peter da Silva) writes:
>While picking nits, how about doing it right. There's really no excuse for
>not calling perror...

Yes there is:  it doesn't do what I want, which is a more informative
message about the high-level nature of the problem.  A major reason why
perror() doesn't get used is that it is simply too inflexible:  it takes
too much extra work to put together a useful message, since that generally
requires assembling an argument string out of pieces.  One often wants
more information than just the filename and the error code.  Something
like the Kernighan&Pike error() function is vastly more useful, but alas,
not everyone has it.  If you're willing to rely on ANSI C facilities (or
imitations of same, e.g. my old strings package), then strerror() can
be used to get much the same effect.
-- 
"Either NFS must be scrapped or NFS    | Henry Spencer at U of Toronto Zoology
must be changed."  -John K. Ousterhout |  henry@zoo.toronto.edu   utzoo!henry
