Ruby program to check a directory is exist or not

bookmark


if (Dir.exists?("mydir") == true)
    puts "Directory exists.";
else
    puts "Directory does not exist.";
end

 


Output:

Directory exists.