Relative path to Absolute Path

K. Shane Hartman ksh at ai.mit.edu
Thu Apr 25 13:22:26 AEST 1991


In article <1515 at geovision.gvc.com> pt at geovision.gvc.com (Paul Tomblin) writes:

   Although I got absolutely zero response to this request, I did find an
   answer.  With the error checking turned off, what I ended up doing was
   approximately this:

	   chdir(new_dir);
	   getcwd(new_dir, MAX_PATH_LEN);

   It works beatifully, on both VMS and unix.  (And probably DOS, but
   I wouldn't bet my life on it.)

Works fine in DOS too.  The only wrinkle I add to it is error checking
for nonexistent path and preserve the original path.

Shane Hartman



More information about the Comp.unix.programmer mailing list