Subject: Re: What should stat("",&fs) return?
To: None <cimaxp1!jb@melb.werple.net.au>
From: None <greywolf@defender.VAS.viewlogic.com>
List: current-users
Date: 05/30/1996 10:47:02
John Birrell writes:

   G'day,

Indeed.

   I just came across some code that (because of another bug) tries
   to stat() a null string. And NetBSD (i386 and alpha) returns zero
   from this test:

[ stat("",(struct stat *)thing) returns zero on NetBSD and -1 elsewhere... ]

   OSF/1 and HPUX return -1 with errno = ENOENT. I would have expected
   NetBSD to behave the same way. Am I missing something?

Historically, BSD has treated "" in a filename context as the current
directory, i.e., "" == ".",  as far as I remember.  SysV always treated
it as an error.  What's PUKIX^H^H^H^HOSIX have to say about this?

				--*greywolf;
--
DAFFYNITIONS
    Demonstrate (DEH m@n strayt) 1. vi.  To remove beasts from, as in a
    dungeon.  (L 'de-', negation + OE 'monster', beast + ME '-ate', perform).
    2. n. A layer of underworld beasties, or, if dealing with computers,
    the ghost in the machine ( L 'demon', beast + 'strata', layers).