From owner-freebsd-stable Mon Apr 30 1:33:59 2001 Delivered-To: freebsd-stable@freebsd.org Received: from segfault.kiev.ua (segfault.kiev.ua [193.193.193.4]) by hub.freebsd.org (Postfix) with ESMTP id 05B6537B422 for ; Mon, 30 Apr 2001 01:33:53 -0700 (PDT) (envelope-from netch@iv.nn.kiev.ua) Received: (from uucp@localhost) by segfault.kiev.ua (8) with UUCP id LMY83557; Mon, 30 Apr 2001 11:33:38 +0300 (EEST) (envelope-from netch@iv.nn.kiev.ua) Received: (from netch@localhost) by iv.nn.kiev.ua (8.11.3/8.11.3) id f3U83qT00812; Mon, 30 Apr 2001 11:03:52 +0300 (EEST) (envelope-from netch) Date: Mon, 30 Apr 2001 11:03:52 +0300 From: Valentin Nechayev To: Ted Faber Cc: stable@FreeBSD.ORG Subject: Re: tail Message-ID: <20010430110352.A646@iv.nn.kiev.ua> References: <20010429222205.A29058@praxis.lunabase.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20010429222205.A29058@praxis.lunabase.org>; from faber@lunabase.org on Sun, Apr 29, 2001 at 10:22:05PM -0700 X-42: On Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Sun, Apr 29, 2001 at 22:22:05, faber (Ted Faber) wrote about "Re: tail": > > juha@cyrus:~$ tail / > > tail: /: Is a directory > > > > More desirable behaviour, IMO. > > FYI, and maybe surprisingly, you're about to start a flame war. BSD > tail and related tools have been treating directories as files for > *many* years. Can you please prove nesessarity of such behavior, as really useful examples of cat/tail of directory, or an example of needed compatibility? If no (and I am sure that you has no such examples), you should consider badness of writing arbitrary binary data to terminal. E.g., xterm & screen terminals can be dropped to unrepairable state in such way. (And, in some file systems, directory can be not flat file with special access methods, but tree, hash or another. Flat reading of such directory is impossible and nonsense.) > The behavior goes back to the earliest UNIX systems. In the earliest UNIX systems, there were no network, VM, and even chdir was an external command which modifies parent's current directory. Do you really want to keep such legacy now? Your idea for unrestricted directory reading is from the same series. > It will not change, nor is it worth arguing about. Well, do use Bell Unix V6 instead of FreeBSD. As for now, no normal utility reads directory directly; they use getdirentries() or getdents(). There are reasons to restrict reading of flat directory dump to special API, e.g. read() after open(,O_FLATDIR). > If you hate the behavior, put a 2-line shell script around tail, cat, > and whatever other programs you want that aborts the operation if the > argument's a directory. There are too many programs in unix tool set which requires such fixing, and it's better to fix them directly instead of total wrapping, isn't it? If you require compatibility with bugs of ancient crap, you'll work on crap. /netch To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message