RosettaCodeData/Task/Check-that-file-exists/BASIC/check-that-file-exists-4.basic
2017-09-25 22:28:19 +02:00

16 lines
502 B
Text

' File exists
f$ = "input.txt"
d$ = "docs"
IF FILEEXISTS(f$) THEN PRINT f$, " exists"
IF FILEEXISTS(d$) AND FILETYPE(d$) = 2 THEN PRINT d$, " directory exists"
f$ = "/" & f$
d$ = "/" & d$
PRINT f$, IIF$(FILEEXISTS(f$), " exists", " does not exist")
PRINT d$, IIF$(FILEEXISTS(d$) AND FILETYPE(d$) = 2, " is", " is not"), " a directory"
f$ = "empty.bac"
PRINT f$, IIF$(FILEEXISTS(f$), " exists", " does not exist")
f$ = "`Abdu'l-Bahá.txt"
PRINT f$, IIF$(FILEEXISTS(f$), " exists", " does not exist")