boten Active Member Licensed User Longtime User Nov 8, 2011 #1 I created a sub-folder ("sdir") under the Files folder of my project. In the Files folder there is one file "a.txt" In the subfolder "sdir" (Files/sdir) there is one file "b.txt" the stmt: Code: Copy Log(File.ListFiles(File.DirAssets )) lists the file and sub-folders in Files (including "a.txt" and "sdir") but the stmt: Code: Copy Log(File.ListFiles(File.DirAssets & "/sdir" )) produce an error The log is: Code: Copy ** Activity (main) Create, isFirst = true ** (ArrayList) [[B]a.txt[/B], images, [B]sdir[/B], sounds, webkit] main_activity_create (java line: 210) java.io.IOException: AssetsDir/sdir is not a folder. Any way to "reach" files in a sub-folder of Files? (I know I can add "b.txt" via the files tab of the project, but that really copies the file to the Files folder - not what I want)
I created a sub-folder ("sdir") under the Files folder of my project. In the Files folder there is one file "a.txt" In the subfolder "sdir" (Files/sdir) there is one file "b.txt" the stmt: Code: Copy Log(File.ListFiles(File.DirAssets )) lists the file and sub-folders in Files (including "a.txt" and "sdir") but the stmt: Code: Copy Log(File.ListFiles(File.DirAssets & "/sdir" )) produce an error The log is: Code: Copy ** Activity (main) Create, isFirst = true ** (ArrayList) [[B]a.txt[/B], images, [B]sdir[/B], sounds, webkit] main_activity_create (java line: 210) java.io.IOException: AssetsDir/sdir is not a folder. Any way to "reach" files in a sub-folder of Files? (I know I can add "b.txt" via the files tab of the project, but that really copies the file to the Files folder - not what I want)
Erel B4X founder Staff member Licensed User Longtime User Nov 8, 2011 #2 You can access a file in a subfolder of the assets folder. However you cannot list this subfolder. If you want to access a file in a subfolder of assets folder you should add the subfolder as a prefix to the file name. The folder should stay File.DirAssets. Upvote 0
You can access a file in a subfolder of the assets folder. However you cannot list this subfolder. If you want to access a file in a subfolder of assets folder you should add the subfolder as a prefix to the file name. The folder should stay File.DirAssets.
boten Active Member Licensed User Longtime User Nov 8, 2011 #3 well, both stmts returned false Code: Copy Log(File.Exists(File.DirAssets,"/sdir/b.txt")) Log(File.Exists(File.DirAssets,"sdir/b.txt")) Upvote 0
well, both stmts returned false Code: Copy Log(File.Exists(File.DirAssets,"/sdir/b.txt")) Log(File.Exists(File.DirAssets,"sdir/b.txt"))
Erel B4X founder Staff member Licensed User Longtime User Nov 9, 2011 #4 File.Exists is also problematic with subfolders of the assets folder. However there is no reason to use it as you do know which files are located there. Upvote 0
File.Exists is also problematic with subfolders of the assets folder. However there is no reason to use it as you do know which files are located there.