Join file name and folder name together : join « File Directory « Ruby






Join file name and folder name together

File.join('home','matz')     # => 'home/matz': relative
File.join('','home','matz')  # => '/home/matz': absolute

 

Related examples in the same category

1.use File.join to put together a filename using directory names and a final filename: