From: Sam Roberts Date: 2003-06-30T22:33:12+09:00 Subject: Re: what is a symlink linked to? Quoteing cyclists@nc.rr.com, on Mon, Jun 30, 2003 at 10:18:10PM +0900: > Is there a method that, given a symlink, returns what the symlink is > linked to? Obviously ls(1) has this information, and stat(1), but I'm There is a stat utility? readlink(2) give this info. > not seeing a way to get it in Ruby. $ ri File.readlink --------------------------------------------------------- File::readlink File.readlink( fileName ) -> fileName ------------------------------------------------------------------------ Returns the given symbolic link as a string. Not available on all platforms. File.symlink("testfile", "link2test") #=> 0 File.readlink("link2test") #=> "testfile"