EXIST


File function EXIST


10
20  EXIST (file)
30
Returns true if file exists.


See examples


If there is insufficient information on this page and you wish learn more about EXIST, please send an email to smallbasic@gmail.com. You can help to improve information about EXIST by submitting an article using the comments link below. Note, an offline language reference text file is now avialable – see the Download section.

Comments


' Return nonexisting file or directory name (12 A..Z letters + extension)
' in the current directory; e.g. filename = tempfile("-me.tmp")
Func tempfile(ext)
Local i, f = Space(12) + ext

Repeat
For i = 1 To 12
f = Replace(f, i, Chr(floor((Rnd * 25.5) + 65)))
Next
Until Not Exist(f)

tempfile = f
End
Func

' demo:
filename = tempfile(".bak")
a << "This is a backup file: " + filename ' append one line
Tsave filename, a
Tload filename, b
? b
Pause

Kill filename ' delete demo file