Droid X2 and ext sd card path

tomb

Member
Licensed User
Longtime User
Machine Droid x2
I have a data directory on my ext SD card and in the data is a file settings.txt
settings.txt = "1000|E"
SDcard data/settings.txt

sdf is defined as "root/sdcard-ext/data"

Msgbox(File.ReadString(sdf, "settings.txt"), "msgbox 1read")
this displays the file contents correctly.

Msgbox(File.ReadString(File.DirRootExternal, "/data/settings.txt"), "msgbox 2read")
cannot find the file and returns a java.1o.FileNotFoundException
The path generated is
/mnt/sdcard/data/settings.txt is clearly wrong. The question is just what should I use instead of File.DirRootExternal to get the right path?
Best Tom B
 

rbsoft

Active Member
Licensed User
Longtime User
Try
B4X:
File.ReadString(File.DirRootExternal, "/sdcard-ext/data/settings.txt")

DirRootExternal points to the built in memory for data. The external sdcard is usually mounted as a folder into it. On my Samssung tablet for example it is "external_sd".

Rolf
 
Upvote 0

tomb

Member
Licensed User
Longtime User
The droid X2 must be different. Changing the msgbox to read: Msgbox(File.ReadString(File.DirRootExternal, "/sdcard-ext/data/settings.txt"), "msgbox 2read")
changed the error message File not found mnt/sdcard/sdcard-ext/data/settings.txt .
Best Tom B
 
Upvote 0

vb1992

Well-Known Member
Licensed User
Longtime User
Have you tried:



Msgbox(File.ReadString("/mnt/sdcard-ext/data/", "settings.txt"),"INFO")

or

Msgbox(File.ReadString("/mnt/sdcard-ext/data", "settings.txt"),"INFO")
 
Upvote 0
Top