RosettaCodeData/Task/Check-that-file-exists/Lua/check-that-file-exists-1.lua
2023-07-01 13:44:08 -04: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 )