RosettaCodeData/Task/Check-that-file-exists/BBC-BASIC/check-that-file-exists.basic

24 lines
505 B
Text
Raw Permalink Normal View History

2023-07-01 11:58:00 -04:00
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