易百教程

60、Ruby中如何检查目录是否存在?

检查目录是否存在可以使用:existsnot exists? 使用方法。

语法:

puts Dir.exists? "dirName"\n