0

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?

user3422952
  • 319
  • 2
  • 8
  • 17
  • When you create the directory, you have a `/` before app data. When you read it, you don't. Is there a reason behind this? – Dan Drews Jul 23 '14 at 12:13
  • I assume you mean the other way around, and because making a directory takes the parent directory and then the folder name as the parameters. It automatically adds the "/" when creating it. – user3422952 Jul 23 '14 at 12:23
  • So where do you create the text.txt ?? – Creator Jul 23 '14 at 12:46

1 Answers1

0

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
Suji
  • 1,326
  • 1
  • 12
  • 27