RosettaCodeData/Task/Check-that-file-exists/Ruby/check-that-file-exists-2.rb
Ingy döt Net 86c034bb8b new files
2013-04-10 12:38:42 -07:00

4 lines
186 B
Ruby

["input.txt", "/input.txt"].each { |f|
printf "%s is a regular file? %s\n", f, File.file?(f) }
["docs", "/docs"].each { |d|
printf "%s is a directory? %s\n", d, File.directory?(d) }