Last active
August 29, 2015 14:10
-
-
Save hpjaj/955320535f302e4172d9 to your computer and use it in GitHub Desktop.
Week 3 - 3e - Directory Manipulation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Returns the path to the current working directory, | |
# in the form of a string | |
Dir.getwd | |
# Creates a new working directory entitled 'tmp' within | |
# the current directory | |
Dir.mkdir("tmp") | |
# Changes the working directory to '/tmp' | |
Dir.chdir(File.join(Dir.getwd, "/tmp")) | |
# Alternate method to get the current working directory | |
Dir.pwd | |
# Go backwards (upwards) one directory | |
Dir.chdir("..") | |
# Delete the 'tmp' directory | |
Dir.delete("tmp") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment