DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

realpath(S)


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(S)

Notices

realpath operates on null-terminated strings.

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


© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 - 01 June 2005