Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!gorodish!guy From: guy%gorodish@Sun.COM (Guy Harris) Newsgroups: comp.unix.wizards Subject: Re: /bin/test and stat(2) Message-ID: <29056@sun.uucp> Date: Thu, 24-Sep-87 18:36:24 EDT Article-I.D.: sun.29056 Posted: Thu Sep 24 18:36:24 1987 Date-Received: Sat, 26-Sep-87 17:47:47 EDT References: <9479@brl-adm.ARPA> Sender: news@sun.uucp Lines: 13 > I understand that the 'stat' system call on a NULL string for a file name > will default to '.' (DOT), the current directory. Umm, it doesn't do this on every system. DO NOT RELY ON THIS BEHAVIOR. > But what I would like to know is, why does the test -d of a > NULL string in the following sample script return true? Don't rely on *this* behavior either - check that a string isn't null before handing it to "/bin/test"! Guy Harris {ihnp4, decvax, seismo, decwrl, ...}!sun!guy guy@sun.com