I\'m working on a program to download a video from YouTube, convert it to MP3 and create a directory structure for the files.
My code is:
FileUtils.cd(\"
You can use the following functions for your purpose:
path = "/path/to/xyz.mp4" File.basename(path) # => "xyz.mp4" File.extname(path) # => ".mp4" File.basename(path, ".mp4") # => "xyz" File.basename(path, ".*") # => "xyz" File.dirname(path) # => "/path/to"