Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!mcvax!ukc!its63b!aiva!richard From: richard@aiva.ed.ac.uk (Richard Tobin) Newsgroups: comp.unix.wizards Subject: Re: /bin/test and stat(2) Message-ID: <182@aiva.ed.ac.uk> Date: Thu, 22-Oct-87 12:17:44 EST Article-I.D.: aiva.182 Posted: Thu Oct 22 12:17:44 1987 Date-Received: Tue, 27-Oct-87 01:01:53 EST References: <9767@brl-adm.ARPA> <231@olgb1.oliv.co.uk> Reply-To: richard@uk.ac.ed.aiva (Richard Tobin,E26 SB x206E,,4477106) Organization: AI Applications Institute, Edinburgh University Lines: 29 In article <231@olgb1.oliv.co.uk> olapw@olgb1.oliv.co.uk (Tony Walton) writes: >In article<9767@brl-adm.ARPA>, franco@MIKEY.BBN.COM (Frank A. Lonigro) writes: >> alone a directory, and why should there be two ways to refer to the same >> thing (the current directory)? It really doesn't make sense! >I don't pretend to know the original reason (if any) for having two ways >to refer to the current directory, but it certainly makes life easier for >the users. Consider the "ls" command - it's easier to type "ls" than "ls ." >every time. On the other hand, "." is necssary as a "place holder" in some >commands - like find, mv, etc. The facts that ls defaults to the current directory and that a null ("") path is equivalent to "." are quite unrelated. The former is because ls looks to see if it has a filename argument, and if it doesn't it uses ".". The second is because the kernel routine namei() allows "" as a degenerate pathname. Thus ls and ls "" both list the current directory, but for quite different reasons. I never use "" for the current directory deliberately; when I encounter it it's usually because of an error - maybe an over-ambitious C-shell backquoted expression that didn't produce any output. -- Richard Tobin, JANET: R.Tobin@uk.ac.ed AI Applications Institute, ARPA: R.Tobin%uk.ac.ed@nss.cs.ucl.ac.uk Edinburgh University. UUCP: ...!ukc!ed.ac.uk!R.Tobin