realpath

Hurricane Electric Internet Services: Accounts starting at $9.95/month
Hurricane Electric Internet Services
     #include <sys/param.h>

     char *realpath(file_name, resolved_name)
     char *file_name;
     char resolved_name[MAXPATHLEN];

DESCRIPTION
     realpath() expands all symbolic links  and  resolves  refer-
     ences  to '/./', '/../' and extra '/' characters in the null
     terminated string named by file_name and stores the  canoni-
     calized   absolute   pathname   in   the   buffer  named  by
     resolved_name.  The resulting path  will  have  no  symbolic
     links components, nor any '/./' or '/../' components.

RETURN VALUE
     If  there  is  no  error,  it  returns  a  pointer  to   the
     resolved_name.

     Otherwise  it  returns  a  NULL  pointer   and   places   in
     resolved_name  the  absolute  pathname of the file_name com-
     ponent which could not  be  resolved.  The  global  variable
     errno is set to indicate the error. If any of the parameters
     are NULL, errno will be set to EINVAL. realpath() indirectly
     invokes  the  readlink(2)  system  call and getwd(3) library
     call (for relative path names), and errno  will  be  set  by
     them.

SEE ALSO
     readlink(2), getwd(3)

WARNINGS
     It  indirectly  invokes  the  readlink(2)  system  call  and
     getwd(3)  library  call (for relative path names), and hence
     inherits the possibility of hanging due to inaccessible file
     system resources.
Hurricane Electric Internet Services: Accounts starting at $9.95/month
Hurricane Electric Internet Services
Copyright (C) 1998 Hurricane Electric. All Rights Reserved.