Path: utzoo!mnetor!uunet!lll-winken!lll-lcc!ames!hao!boulder!cdash From: cdash@boulder.Colorado.EDU (Charles Shub) Newsgroups: comp.unix.questions Subject: Re: path names in header files Message-ID: <1573@boulder.Colorado.EDU> Date: 2 Mar 88 21:17:52 GMT Reply-To: cdash@boulder.Colorado.EDU (Charles Shub) Organization: University of Colorado at Colorado Springs Lines: 15 Summary: solution several days ago, I posted a question about pathnames being immune to one being relocated to another directory. Several solutions were posed via mail and this composite of the ideas seems to work well. It doesn't clutter up the environment with lots of path name variables and is minimal overhead: #define RELPATH a/b/c /* path from your home directory */ if (!(home = getenv("HOME"))) syserr("HOME not defined"); if (!(abs = malloc((unsigned) (strlen(RELPATH) + strlen(home) + 2)))) syserr("could not get path storage"); open(strcat(strcat(strcpy(abs,home),"/"),RELPATH),FLAGS,MODE); -- cdash aka cdash@boulder.colorado.edu aka ...hao!boulder!cdash aka ...nbires!boulder!cdash aka (303) 593-3492