Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!rutgers!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.unix.wizards Subject: Re: Nullpath in system calls considered harmful? Message-ID: <9589@smoke.BRL.MIL> Date: 4 Feb 89 08:01:07 GMT References: <88368@sun.uucp> Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 13 In article <88368@sun.uucp> lm@sun.UUCP (Larry McVoy) writes: > A question for oldtimers: is there any good reason that null paths > (ie, open("", flags)) should NOT be considered an error. If you don't > already know that many kernels translate "" into "." you probably > can't answer this question. POSIX wants "" to be an error. We've discussed this before (Dennis even chipped in). From one point of view "" is a natural way to designate the CWD. However, it can lead to unpleasant surprises in usages such as: strcat( strcat( strcat( strcpy( cmd, "rm " ), dir ), "/" ), file ); system( cmd ); Also, "" is often the result of program bugs and having it be an illegal pathname is safer than letting the operation occur.