Path: utzoo!attcan!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.bugs.4bsd Subject: Re: 4.3 Tahoe rrestore bug Keywords: 4.3,tahoe,restore Message-ID: <486@auspex.UUCP> Date: 22 Nov 88 17:20:58 GMT References: <23669@pprg.unm.edu> <921@bacchus.dec.com> Reply-To: guy@auspex.UUCP (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 28 ># 1) dirfile is NOT a directory but a file (created by rrestore) > >I don't know about the rest of your article, but this I can answer: it knows >it's trying to open a dirfile, it just copied it in from the tape. The ndir(3) >routines don't care if it's really a directory, just as long as the format is >compatible. The routines are read-only since they run in user-mode; if you >point 'em at a file that happens to look like a directory, they work fine. Note that under SunOS: 1) The directory library routines use "getdirentries()" in 2.x and 3.x releases, and "getdents()" in 4.0. 2) Those routines transform the contents of the file; they are not equivalent to "read()" on a directory file. 3) I don't know whether those routines work on non-directory files. 4) In any case, "opendir()" returns an error when you try to open a file that isn't a directory. The bottom line is that the format isn't compatible, so you can't point the directory library routines at a non-directory, even if it happens to look like one. The SunOS version of "restore" contains what amounts to a copy of the "old" directory library (the one that directly reads the directory file).