Does Directory Exist?

Bill Norris

Active Member
Licensed User
Longtime User
We use file.exists to test for the presence of a file -- how do we test for the presence of a directory?
 

Inman

Well-Known Member
Licensed User
Longtime User
Not sure but I believe it works the same for directories as well. Try replacing the file name with the directory name you want to check.
 
Upvote 0

pluton

Active Member
Licensed User
Longtime User
Check this post on forum

Test if a directory exsist

or here it is sample code:

B4X:
File.MakeDir(File.DirRootExternal, "memoBackup")
    
MyPath = File.DirRootExternal & "/memoBackup/"
    
If File.Exists(MyPath, "") = False Then
        Msgbox("False","")
Else
    Msgbox("True","")
End If
 
Upvote 0
Top