filters
Charles Bryant
ch at dce.ie
Tue Dec 4 21:56:12 AEST 1990
In article <10763:Dec221:21:1590 at kramden.acf.nyu.edu> brnstnd at kramden.acf.nyu.edu (Dan Bernstein) writes:
>... cat should use read() and write() for efficiency and
>error checking, but that means a rewrite that nobody's bothered doing.
Well I can't resist a challenge like that. See <1990Dec4.103255.14195 at dce.ie>
in alt.sources. Not only does it use read() and write(), and checks for
errors on close(), but it also has the nice feature of having no features.
Many cat programs have several options, none of which can really be justified:
-u (unbuffered). My cat is always unbuffered. dd(1) is for buffering
-s (silent). Just use "cat 2>/dev/null".
-v (show control characters) That's a job for a seperate program
Anyway, my cat.c is available in alt.sources. It is public domain - you
can sell it or give it away or ignore it as you like.
Btw, I agree that its silly having to check for errors on close().
--
Charles Bryant (ch at dce.ie)
--
/usr/ch/.signature: Block device required
More information about the Comp.unix.programmer
mailing list