Ruby/File Directory/pwd

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск

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



find out what the current directory is with Dir.pwd

puts Dir.pwd
Dir.chdir("/usr/bin")
puts Dir.pwd