redirecting output

Peter da Silva peter at ficc.ferranti.com
Thu Jul 5 11:16:15 AEST 1990


In article <1990Jul3.171151.6137 at zoo.toronto.edu> henry at zoo.toronto.edu (Henry Spencer) writes:
> In article <JID4B=4 at ficc.ferranti.com> peter at 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.

"Can't open %s for reading" does?

> 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.

Or simply calling perror and following it with a text description, which is
what I have done in the past in the fow cases a simple perror hasn't been
enough.

Let's face it. Perror isn't perfect, but it's a LOT better than what people
actually use. Strerror will be better, when it becomes widely available, but
a simple call to perror covers most cases.

In any case, there isn't any excuse for using something *worse* than perror.
And there's no excuse for cat(1) still not using perror in System V.3.2.
-- 
Peter da Silva.   `-_-'
+1 713 274 5180.
<peter at ficc.ferranti.com>



More information about the Comp.lang.c mailing list