change directories (using an absolute path), and then store the value of the directory path in a variable. : pwd « File Directory « Ruby






change directories (using an absolute path), and then store the value of the directory path in a variable.


Dir.chdir( "/Users/mikejfz" )
home = Dir.pwd 
p home 

 

Related examples in the same category

1.find out what the current directory is with Dir.pwd