RosettaCodeData/Task/Check-that-file-exists/Ruby/check-that-file-exists-2.rb
2023-07-01 13:44:08 -04: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) }