Subject: Re: This should be the final cat(1) patch...
To: None <tech-userlevel@netbsd.org>
From: Alan Barrett <apb@cequrux.com>
List: tech-userlevel
Date: 06/08/2002 19:54:37
On Sat, 08 Jun 2002, Mason Loring Bliss wrote:
> > While we are adding flags to cat, how about "-a" flag to do
> > fcntl(STDOUT_FILENO, O_APPEND) ?
> 
> There's no equivalent functionality to the -l flag currently. However, how
> would -a differ from "cat >> foo"?

Shells usually handle "cat >>foo" by opening the output file without
O_APPEND, and seeking to the end of file.  This does not provide the
same guarantee as O_APPEND in the face of multiple writers to the same
file.

However, I now think that adding a simple "-a" flag to cat would not be
useful.  A useful implementation would require more parameters to
control what sort of buffering was done, and therefore what data goes
into each write() call.  This is looking more like a job for dd than
for cat.

--apb (Alan Barrett)