Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

class method

File.join

(*::path) -> ::String
File.join(*components) → string

Returns a new string formed by joining the given string components with character '/':

Example
File.join                   # => ""
File.join('foo')            # => "foo"
File.join(*%w[bar baz bat]) # => "bar/baz/bat"
See also .identical? .lchmod .grpowned? .lchown also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0