Answers for "ruby get the folder path via file path"

2

ruby filename from path

path = "/path/to/file.ext"

File.basename(path) # 'file.ext'
Posted by: Guest on August-31-2020
0

get directory of current file ruby

__dir__
Posted by: Guest on April-25-2021

Code answers related to "ruby get the folder path via file path"

Browse Popular Code Answers by Language