DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

realpath(3C)


realpath -- returns the real file name

Synopsis

   #include <stdlib.h>
   #include <sys/param.h>
   

char *realpath (const char *file_name, char *resolved_name);

Description

realpath resolves all links, symbolic links, and references to ``.'' and ``..'' in file_name and stores it in resolved_name.

realpath takes as input both relative and absolute path names. It returns the ``resolved absolute'' name.

resolved_name must be big enough (MAXPATHLEN) to contain the fully resolved path name.

Return values

If there is no error, realpath returns a pointer to the resolved_name. Otherwise it returns a null pointer and places the name of the offending file in resolved_name. The global variable errno is set to indicate the error.

References

getcwd(3C)

Notices

realpath operates on null-terminated strings.

One should have execute permission on all the directories in the given and the resolved path.


© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004