RosettaCodeData/Task/Check-that-file-exists/BBC-BASIC/check-that-file-exists.basic
2023-07-01 13:44:08 -04:00

23 lines
505 B
Text

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