End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
class method
File.path
File.path(path) → string
file.c
View on GitHub ↗
static VALUE
rb_file_s_path(VALUE klass, VALUE fname)
{
return rb_get_path(fname);
}
Returns the string representation of the path
Example
File.path("/dev/null") #=> "/dev/null" File.path(Pathname.new("/tmp")) #=> "/tmp"