Since we're on the subject, does anyone knows how to find a particular file in the internal phone storage?
I've tryed something like this:
If File.Exists(File.DirInternal, "options.txt") Then
List1 = File.ReadList(File.DirInternal, "options.txt")
... (etc)
If List1.Size<1 Then Msgbox("nothing found...","Info")
I always get nothing found... But the file is there!!! Is it the path that must be defined? Which path?
I'm....confused...
There's your confusion, DirRootExternal and DirDefaultExternal points to the internal SD Card, DirInternal is accessible just to your app, my question is, where and how are you creating that "options.txt" file, can you post the code?
I'm very sorry to bother you like this.
I've placed the mentioned file in the internal storage - in the folder apptest - of the cell phone; I copied it from my computer to the internal storage.
Now I'm trying to retrieve it using B4A.
Do you have any idea how to do this?
I sure ain't....
Note that is recommended to use DirDefaultExternal instead of DirRootExternal, the reason for that is because when/if the app is uninstalled all files created by the app should be also removed, if the files are created on DirRootExternal they will remain, taking unnecessary space on the device.
I think what the problem is so far....Everyone's right - and everyone's wrong (specially me).
I created the apptest folder in the internal storage root - and placed the options.txt file there. I did it manually with the explorer of the cell phone.
That would bring the file path as storage/emulated/0/apptest/options.txt
The reason I can't reach this file, is because the script is searching for it in my b4a app files: storage/emulated/0/Android/data/my.script/files/apptest/options.txt
Don't I have access to the root directory like the phone explorer app? The device is not rooted.
Yes, You can create a folder in the root of the internal SD card called apptest then the text file will be referred to like this:
File.DirRootExternal & "/apptest/options.txt"