From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Viro To: 9fans@cse.psu.edu Subject: Re: [9fans] 9fs/9auth for FreeBSD In-Reply-To: <3AC4D947.54205AD6@arl.army.mil> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Date: Mon, 2 Apr 2001 06:23:01 -0400 Topicbox-Message-UUID: 78430ac2-eac9-11e9-9e20-41e7f4b1d025 On Mon, 2 Apr 2001, Douglas A. Gwyn wrote: > Alexander Viro wrote: > > ... I'm not sure that it's the right thing to do, though. > > UNIX has always had files that have an innate append-only > characteristic, > although it didn't let you specify that a different kind of file should > be treated as having that characteristic. The UNIX behavior was that > write to such a file succeeded, appending to the end of course, and > seek attempts (to other than the end) would fail. If some "modern" Erm. There is a little problem with lseek() returning errors - reading these files is perfectly sane thing. Pipes et.al. have innate append-only characteristic, indeed, but append-only regular files are different - think of that as enforcement (silent or not - that's where the differences are) of O_APPEND. > UNIX-like system wants to support user designation of files as having "modern" is a relative term - whether you want to consider 4.4BSD as such or not is a matter of taste, but behaviour in question goes back at least to '93 (I don't have CVS logs at hand; most likely the thing was added not just before the release, so s/93/early 90s/) > an append-only characteristic, then files that have that characteristic > innately ought to report that the corresponding flag is always set, and > serve as the model for how I/O is performed. IIRC, rationale for append-only _inode_ flag (not O_APPEND) was handling of the logs and similar animals. That's definitely the most frequent use of that thing. The only real question being: what's better - complaining about echo foo > append_only_file or silently assuming that >> was implied.