Check to see if a dicectory exists : exist « File Directory « Ruby






Check to see if a dicectory exists


directory_name = 'a_directory'
FileUtils.mkdir(directory_name)
File.file? directory_name                    # => false
File.exists? directory_name                  # => true

 








Related examples in the same category

1.Checking If a File Exists
2.Create class to wrap File.exist and File.new method
3.Checking to See if a File Exists