Skip to content

End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

class method

File.path

File.path(path) → string

Returns the string representation of the path

Example
File.path("/dev/null")          #=> "/dev/null"
File.path(Pathname.new("/tmp")) #=> "/tmp"
See also #path .owned? .pipe? .open also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1