A dumb (?) files question

mjtaryan

Active Member
Licensed User
Longtime User
Where will I find how to specify relative paths? For example providing once the path to a "root" directory with subdirectories containing the various assets and then being able to specify the path to a given file relative to that "root" directory. Thanks.
 

Djembefola

Active Member
Licensed User
Longtime User
B4X:
Dim rootfolder as String
Dim subfolder as String
Dim s1, s2, s3, s4 as String

rootfolder=file.DirDefaultExternal
s1="planets"
s2="earth"
s3="europe"
s4="germany"

subfolder = "/" & s1 & "/" & s2 & "/" & s3 & "/" & s4


if File.Exists(rootfolder & subfolder, "myfile.txt") then
...
end if
 
Upvote 0
Top