Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!decvax!bellcore!ulysses!cbosgd!ucbvax!CIS.UPENN.EDU!david%upenn-dsl From: david%upenn-dsl@CIS.UPENN.EDU Newsgroups: mod.computers.vax Subject: UNIX file name parsing Message-ID: <8607091939.AA02783@upenn-dsl> Date: Wed, 9-Jul-86 15:39:39 EDT Article-I.D.: upenn-ds.8607091939.AA02783 Posted: Wed Jul 9 15:39:39 1986 Date-Received: Fri, 11-Jul-86 00:23:29 EDT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The ARPA Internet Lines: 17 Approved: info-vax@sri-kl.arpa Today I found a bug/feature in the UNIX file name parsing code. If it is given a null name, i.e. "", it returns the current directory. Now, it is quite obvious why it does this. But, it is not obvious that it should do this. I have written a routine that is to open a filename and do some stuff with the descriptor. The program user is to enter a line consisting of a command name and a file name. Well, if the user forgets the filename, WHAM, he gets a file full of garbage. To avoid this, I have to put in a check for null filenames, rather then letting the null name go to the routine that opens the file. I figured a null filename was invalid, so I figured this routine would barf at it through my controlled error detection. But NOOOOOOOOOOOOO. What do you think folks? Is this a bug or a feature? Dave Feldman