To change directory within a Ruby program, use Dir.chdir: : chdir « File Directory « Ruby






To change directory within a Ruby program, use Dir.chdir:

Dir.chdir("/usr/bin")

 

Related examples in the same category

1.Compare a variable storing a directory path with the current directory