Accessing files using simulator

wdegler

Active Member
Licensed User
Longtime User
I have a text file in my app's "File" folder and a reference to it in my app's file list (just as done for the "bal" file). How can my app find this file for reading or writing when I use the B4A simulator? I am thinking of statements similar to Txt=File.ReadString(File.DirRootExternal,Filename) or
LogLst=File.ReadList(File.DirInternal,"Log.txt"). This is not a problem using an actual device.
 

klaus

Expert
Licensed User
Longtime User
The files in DirAssets are only redable, if you need to write to these files you must copy them from DirAssets to DirInternal, DirRootExternal and then access them from there. To avoid that you always copy the original file you must check if the does exist in the other directory, and copy the file only if it's not already there.

Best regards.
 
Upvote 0

wdegler

Active Member
Licensed User
Longtime User
Thank you both

Thank you both for your responses. This problem seems to have disappeared all by itself. I am using DirRootExternal for both writing and reading files and it is working ... now.
 
Upvote 0
Top