Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!ames!hc!lanl!cmcl2!adm!smoke!gwyn From: gwyn@smoke.BRL.MIL (Doug Gwyn ) Newsgroups: comp.lang.c Subject: Re: access() Message-ID: <9634@smoke.BRL.MIL> Date: 9 Feb 89 01:30:55 GMT References: Reply-To: gwyn@brl.arpa (Doug Gwyn (VLD/VMB) ) Distribution: comp Organization: Ballistic Research Lab (BRL), APG, MD. Lines: 21 In article lfk@mbio.med.upenn.edu (Lee Kolakowski) writes: >What does ANSI say about the filename argument passed to the access() >function? Especially with regard to directorys. >For example, in RCS there are statements like > access("./RCS/", 000) >But under a supposedly ANSI compiler (MSC 5.1) these lines return an >error that says RCS/ does not exist when RCS/ is fine. >If the filename is "RCS" everything is just fine, and the proper >response is returned. >Is this the correct behavior? This is not an ANSI C issue; interpretation and validity of strings used as filenames is up to the implementation. Your operating system apparently thinks that "RCS/" is not a valid pathname. I seem to recall that the SVID requires this behavior. 7th Edition UNIX interpreted that string as denoting file "" in directory "RCS", and took "" to mean the current directory (same as "."). One would guess that RCS was developed on a 7th-Ed.-derived system, probably 4.somethingBSD. The simplest fix is to append "." to such strings.