Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 beta 3/9/83; site sdcrdcf.UUCP Path: utzoo!watmath!clyde!burl!ulysses!mhuxl!houxm!vax135!cornell!uw-beaver!tektronix!hplabs!sdcrdcf!markb From: markb@sdcrdcf.UUCP (Mark Biggar) Newsgroups: net.unix-wizards Subject: Re: null filename handling question Message-ID: <1290@sdcrdcf.UUCP> Date: Tue, 4-Sep-84 16:39:49 EDT Article-I.D.: sdcrdcf.1290 Posted: Tue Sep 4 16:39:49 1984 Date-Received: Fri, 14-Sep-84 20:35:11 EDT References: <744@opus.UUCP> Reply-To: markb@sdcrdcf.UUCP (Mark Biggar) Organization: System Development Corporation, Santa Monica Lines: 29 Summary: In article rcd@opus.UUCP (Dick Dunn) writes: >Since posting my original query, I've been corrected--V7 and older systems >treat a null file name as the current directory; Sys III treats it as a >nonexistent file. But I'm still curious about the reason for "" meaning >the current directory. I don't imagine that it was planned on, it kind of just happened. The code in the file system name resolution routine probably goes: if name starts with slash then use root directory else use current directory endif while not end of string if current file not directory then error get and skip over next name find in current file use it as current file endwhile Note that this resolves "/" to the right thing, but has the side effect of resolving "" to the current directory. This is also explains why things like "cd /usr/spool/" work on v7 & 4bsd and not on system III. Mark Biggar {allegra,burdvax,cbosgd,hplabs,ihnp4,akgua,sdcsvax}!sdcrdcf!markb