Path: utzoo!attcan!uunet!ficc!peter From: peter@ficc.ferranti.com (Peter da Silva) Newsgroups: comp.lang.c Subject: Re: redirecting output Message-ID: Date: 5 Jul 90 01:16:15 GMT References: <22931@dartvax.Dartmouth.EDU> <1990Jun29.172429.2818@zoo.toronto.edu> <1990Jul3.171151.6137@zoo.toronto.edu> Reply-To: peter@ficc.ferranti.com (Peter da Silva) Organization: Xenix Support, FICC Lines: 25 In article <1990Jul3.171151.6137@zoo.toronto.edu> henry@zoo.toronto.edu (Henry Spencer) writes: > In article 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. "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.