Date: Thu, 25 Sep 2003 15:26:38 GMT From: Mark <admin@asarian-host.net> To: <freebsd-questions@freebsd.org> Subject: Re: Re:Re: Cat a directory Message-ID: <200309251526.H8PFQBRP090735@asarian-host.net> References: <200309251421.h8PEL0Gr028335@clunix.cl.msu.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
----- Original Message ----- From: "Jerry McAllister" <jerrymc@clunix.cl.msu.edu> To: "Mark" <admin@asarian-host.net> Cc: <freebsd-questions@freebsd.org> Sent: Thursday, September 25, 2003 4:21 PM Subject: Re: Re:Re: Cat a directory But nonetheless very illustrative of how the OS takes into consideration an unexpected, and probably unintended, behavior; namely, unlinking a directory, whereas the user expects it to operate on regular files. Hence, by default, it does NOT unlink directories, and only does so when you specifically add the -d (-r) override. And that, to me, makes perfect sense. Moreover, I feel the same logic should apply to "cat". > If you want a special flag to make cat treat directories specially, > then go ahead and write it and submit it. BUT DO NOT CHANGE THE > DEFAULT BEHAVIOR OF CAT OR YOUR MODIFICATION WILL BE REJECTED BECAUSE IT > WOULD BREAK THOUSANDS OF SCRIPTS AND BE FOOLISH AND UNNECESSARY!!!!!!!! Uh-uh; and no default behavior has ever been changed over the years, eh? :) And what is with these "thousands of scripts" that would suddenly break horribly? So far, I have only heard one good scenario: a specific instance where one would wish to obtain a hex-dump on the actual contents of the directory file; and I even doubt such a use would find its way to a script (as it would probably be a one-time use for debugging/finding lost files or something). In 99.9 percent you will find that "cat" is used on regular files. That figure is actually probably closer to 99.99999 percent; but I'll be mild. When you spell it out like that, what should be "default behavior" becomes clear. > Now, either contribute something or be done with it. I contributed a few clear, well-argumented reasons in favor of my position that "cat" should change its default behavior. You, otoh, have only demonstrated that you are a bully, and that you can yell real loud. Well, that don't impress me much. - Mark
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200309251526.H8PFQBRP090735>