returns the real file name
char *realpath (const char *file_name, char *resolved_name);
resolves all links, symbolic links, and references to ``.'' and ``..'' in
file_name and stores the path in
It can handle both relative and absolute path names:
resolved_name must be big enough
(MAXPATHLEN) to contain the fully resolved path name.
For absolute path names and the relative names whose resolved name
cannot be expressed relatively (for example,
../../reldir), it returns the
resolved absolute name.
For the other relative path names, it returns the
resolved relative name.
operates on null-terminated strings.
You should have execute permission on all the directories
in the given and the resolved path.
If an error occurs,
may fail to return to the current directory.
If there is no error,
returns a pointer to the
Otherwise it returns a null pointer
and places the name of the offending file in
The global variable
is set to indicate the error.
If any of the following conditions occur, this function returns
-1 and sets errno to the corresponding value:
The following conditions might cause the function to fail:
The system denied you read or search permission for some part of
One of the arguments
resolved_name is a null pointer.
The function encountered an I/O error while reading from the file system.
The function found too many symbolic links while resolving the
or a component of the path name is longer than
Either a component of
does not exist or
points to an empty string.
Part of the pathname prefix is not a directory.
Resolving a symbolic link in the pathname produced an
intermediate result that is longer than
There is not enough memory.
is conformant with
X/Open CAE Specification, System Interfaces and Headers, Issue 4, Version 2.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003