home *** CD-ROM | disk | FTP | other *** search
- From: pt@geovision.gvc.com (Paul Tomblin)
- Newsgroups: alt.sources,comp.unix.programmer,comp.os.vms
- Subject: Re: Relative path to Absolute Path
- Message-ID: <1515@geovision.gvc.com>
- Date: 23 Apr 91 18:32:15 GMT
-
- pt@geovision.gvc.com (Paul Tomblin) writes:
-
- >Does anybody have a routine to go from a relative file (or directory) path to
- >an absolute (rooted) one? I need one for both unix and vms. I need to be
- >able to go from relative to absolute in the following cases:
-
- 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.)
-
- --
- Paul Tomblin, Department of Redundancy Department. ! My employer does
- Two roads diverged in a wood, and I/ I took the one less ! not stand by my
- travelled by/ And that is why I'm lost, dammit... ! opinions....
- pt@geovision.gvc.com or {cognos,uunet}!geovision!pt ! Me neither.
-