Ruby/File Directory/chdir
Материал из Wiki.crossplatform.ru
Версия от 17:57, 13 сентября 2010; ViGOur (Обсуждение | вклад)
Compare a variable storing a directory path with the current directory
ruby_progs = "/Users/Ruby" if not Dir.pwd == ruby_progs Dir.chdir ruby_progs end
To change directory within a Ruby program, use Dir.chdir:
Dir.chdir("/usr/bin")