OS independent : File SEPARATOR « File Directory « Ruby






OS independent


File.join(File::SEPARATOR , 'full', 'path', 'here', 'filename.txt')

 

Related examples in the same category

1.use File.expand_path to turn basic filenames into complete paths