file readlink

file readlink name

Returns the value of the symbolic link given by name (i.e. the name of the file it points to). If name isn't a symbolic link or its value cannot be read, then an error is returned. On systems that don't support symbolic links this option is undefined.


AMG: Is there any difference between [file readlink $link] and [file link $link]?


GNU coreutils provides "readlink -f", which outputs the canonical location for a file. Here's a TCL proc that does the same:

http://ynform.org/w/Pub/TclFileCanonicalize (Dead link as of 12-02-2014)


See also