Ruby program to check a directory is exist or not
if (Dir.exists?("mydir") == true)
puts "Directory exists.";
else
puts "Directory does not exist.";
end
Output:
Directory exists.
