Check that file exists: Difference between revisions
Content added Content deleted
(→{{header|Euphoria}}: Euphoria example added) |
(Added BBC BASIC) |
||
Line 182:
if exist docs echo The following directory called docs exists.
if exist \docs\ echo The following directory called \docs\ exists.</lang>
=={{header|BBC BASIC}}==
<lang bbcbasic> test% = OPENIN("input.txt")
IF test% THEN
CLOSE #test%
PRINT "File input.txt exists"
ENDIF
test% = OPENIN("\input.txt")
IF test% THEN
CLOSE #test%
PRINT "File \input.txt exists"
ENDIF
test% = OPENIN("docs\NUL")
IF test% THEN
CLOSE #test%
PRINT "Directory docs exists"
ENDIF
test% = OPENIN("\docs\NUL")
IF test% THEN
CLOSE #test%
PRINT "Directory \docs exists"
ENDIF</lang>
=={{header|C}}==
|