Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →
class method
File.readlink
(::string | ::_ToPath link_name) -> ::String
File.readlink(link_name) → file_name
file.c
View on GitHub ↗
static VALUE
rb_file_s_readlink(VALUE klass, VALUE path)
{
return rb_readlink(path, rb_filesystem_encoding());
}
Returns the name of the file referenced by the given link. Not available on all platforms.
Example
File.symlink("testfile", "link2test") #=> 0 File.readlink("link2test") #=> "testfile"
See also
.readable_real?
.realdirpath
.readable?
.realpath
also in
4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0