Returns the absolute path name of a file, with all references resolved.
#include <sys/stat.h> char *realpath ( const char *file_name, char *resolved_name );
(IN) Points to the location and name of the file.
(OUT) Points to a buffer containing the path name of the file, with any ./ or ../ references resolved.
If successful, returns 0. Otherwise, returns -1 and sets errno to one of the following:
The realpath function derives from the path pointed to by the file_name parameter an absolute path name, which does not include any ./ or ../ references. The generated path name is stored as a null-terminated string in the resolved_name parameter. The type of path returned depends upon whether you are using POSIX path semantics. If you are, the resolved_name parameter uses POSIX semantics. If you are using NetWare semantics, the path returned uses NetWare semantics.
If you specify just a filename in the file_name paramter, the resolved_name parameter returns the full path of the file in the current working directory.
If you have compiled your NLM to use POSIX semantics, you can also use the realpath function to convert a NetWare path into a POSIX path. Use the file_name parameter for the NetWare path, and the resolved_name parameter returns the POSIX path, reflecting the information in the etc/pathtab file. For more information about this file, see Section 13.2, POSIX Path Semantics.
If you are using NetWare semantics, the file_name parameter must use NetWare semantics, and the resolved_name parameter always returns NetWare semantics.