B4A - making and referring to a directory?

887 views Asked by At

In B4A (or just Visual Basic), I've created a directory:
Files.MakeDir(Files.DirInternal, "app_data)
However, when I try and read a file I get an error stating the directory/file doesn't exist:
Files.ReadString(Files.DirInternal & "/app_data", "text.txt")

Is there a different way in which I should go into the directory to read the file?

1

There are 1 answers

0
Suji On

Creating new directory if no such directory exist

pth = "d:\user_login"
        If Directory.Exists(pth) = False Then
            Directory.CreateDirectory(pth) 'create a folder in the path is no such folder is existing
End If