Ruby/File Directory/pwd

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

Версия от 17:10, 26 мая 2010; (Обсуждение)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

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