method

realpath

v1_9_2_180 - Show latest stable - Class: Pathname
realpath(basedir=nil)
public

Returns the real (absolute) pathname of self in the actual filesystem not containing symlinks or useless dots.

All components of the pathname must exist when this method is called.

1Note

Will raise error on broken symlink

Mange ยท Nov 7, 2010

This method will raise Errno::ENOENT on a broken symlink. You should probably rescue it every time you call this method.