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

12 lines
354 B
Lua

function output( s, b )
if b then
print ( s, " does not exist." )
else
print ( s, " does exist." )
end
end
output( "input.txt", io.open( "input.txt", "r" ) == nil )
output( "/input.txt", io.open( "/input.txt", "r" ) == nil )
output( "docs", io.open( "docs", "r" ) == nil )
output( "/docs", io.open( "/docs", "r" ) == nil )