RosettaCodeData/Task/Check-that-file-exists/BASIC/check-that-file-exists-3.basic
Ingy döt Net d066446780 langs a-z
2013-04-10 22:43:41 -07:00

21 lines
353 B
Text

f$ = "input.txt"
GOSUB opener
f$ = "\input.txt"
GOSUB opener
'can't directly check for directories,
'but can check for the NUL device in the desired dir
f$ = "docs\nul"
GOSUB opener
f$ = "\docs\nul"
GOSUB opener
END
opener:
d$ = DIR$(f$)
IF LEN(d$) THEN
PRINT f$; " found"
ELSE
PRINT f$; " not found"
END IF
RETURN