Under Mac OS X, the /etc directory is actually a symbolic link.
The following statement reads it and returns the location to
which the link points: path = FILE_READLINK('/etc') It is
possible to have chains of symbolic links, each pointing to
another. The following function uses FILE_READLINK to
iteratively translate such links until it finds the actual file:
FUNCTION RESOLVE_SYMLINK, path savepath = path ; Remember last
successful translation WHILE (path NE '') DO BEGIN path =
FILE_READLINK(path, /ALLOW_NONEXISTENT, $ /ALLOW_NONSYMLINK) IF
(path NE '') THEN BEGIN ; If returned path is not absolute, use
it to replace the ; last path segment of the previous path. IF
(STRMID(path, 0, 1) NE '/') THEN BEGIN last = STRPOS(savepath,
'/', /REVERSE_SEARCH) IF (last NE -1) THEN path =
STRMID(savepath, 0, last) $ + '/' + path savepath = path ;
FILE_EXPAND_PATH removes redundant things like /./ from ; the
result. Returns the path associated with a symbolic link. A
scalar string or string array containing the names of th