Check that file exists: Difference between revisions

Content added Content deleted
(→‎{{header|Perl}}: add Perl 6 entry)
Line 454: Line 454:
<lang logo>setprefix "/
<lang logo>setprefix "/
show file? "input.txt</lang>
show file? "input.txt</lang>
=={{header|Lua}}==
<lang 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 )</lang>


=={{header|Mathematica}}==
=={{header|Mathematica}}==