Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!virtech!cpcahil From: cpcahil@virtech.UUCP (Conor P. Cahill) Newsgroups: comp.lang.c Subject: Re: strcat/access question Message-ID: <1226@virtech.UUCP> Date: 4 Oct 89 01:00:22 GMT References: <5409@umd5.umd.edu> <9733@chinet.chi.il.us> Organization: Virtual Technologies Inc Lines: 25 In article <9733@chinet.chi.il.us>, john@chinet.chi.il.us (John Mundt) writes: > home is a char pointer, pointing to somewhere in the environmental > variable area that was passed to main since that is where getenv() > looks for things like HOME. > > When you concatenated home with the rest of the path, it would have > to step on other environmental variables, probably one that was > needed by access(). The part about stepping on other environment variables is true, but the cause of the problem is not that access() requires something in the environment. access(2) is a system call and system calls don't use any such thing as an environment variable (can you imagine the kernel searching through your data space looking for some strings?) The problem is that the original poster appended the path from his HOME directory to the file twice thereby generating a non-existent file name. -- +-----------------------------------------------------------------------+ | Conor P. Cahill uunet!virtech!cpcahil 703-430-9247 ! | Virtual Technologies Inc., P. O. Box 876, Sterling, VA 22170 | +-----------------------------------------------------------------------+