Changes

Jump to: navigation, search

Ruby Directory Handling

4 bytes removed, 15:11, 19 March 2009
Changing Directory in Ruby
First, it is often useful to identify the current directory. This can be done with the ''pwd'' methods of the Ruby ''Dir'' class:
<prett>
Dir.pwd
=> "/home/ruby"
</prett>
Changing the current working directory in Ruby is achieved using the ''chdir'' method of the Ruby ''Dir'' class. This methods takes the path of the destination directory as an argument:
<prett>
Dir.chdir("/home/ruby/test")
</prett>
== Creating New Directories ==

Navigation menu