Используйте File#lstat()
. Пример:
# This is a dummy symlink; there's no file named "foo".
ln -s foo bar
# Run irb.
irb(main):001:0> File.lstat("bar")
=> #<File::Stat dev=0x801, ino=90113, mode=0120777, nlink=1, uid=1000, gid=1000, rdev=0x0, size=3, blksize=4096, blocks=0, atime=2010-01-05 17:59:06 -0500, mtime=2010-01-05 17:59:05 -0500, ctime=2010-01-05 17:59:05 -0500>
# Get the mtime of the link.
irb(main):002:0> File.lstat("bar").mtime
=> 2010-01-05 17:59:05 -0500