Sep 18, 2025 Replies: 7 Normally if you try and do Code: Copy Log(File.ListFiles(File.DirAssets)) you get message cant list DirAssets Code: Copy Dim currentFilesFolder = File.DirApp.Replace("Objects","Files") Log(File.ListFiles(currentFilesFolder)) Seems to work fine (also for saving to the directory too in debug) Probably a good reason not to do it though. Last edited: Sep 18, 2025 Click to expand...
Normally if you try and do Code: Copy Log(File.ListFiles(File.DirAssets)) you get message cant list DirAssets Code: Copy Dim currentFilesFolder = File.DirApp.Replace("Objects","Files") Log(File.ListFiles(currentFilesFolder)) Seems to work fine (also for saving to the directory too in debug) Probably a good reason not to do it though.
LucaMs Expert Licensed User Longtime User Sep 18, 2025 #2 Daestrum said: Probably a good reason not to do it though. Click to expand...
Erel B4X founder Staff member Licensed User Longtime User Sep 18, 2025 #3 It will not work in release mode, when you run it outside of the project. It will only work when the "development" Files folder is accessible.
It will not work in release mode, when you run it outside of the project. It will only work when the "development" Files folder is accessible.
Erel B4X founder Staff member Licensed User Longtime User Sep 18, 2025 #4 A solution that will work in all modes: 1. Add to Main or B4XMainPage: Code: Copy #CustomBuildAction: folders ready, %WINDIR%\System32\cmd.exe, /c dir /b ..\Files\ > ..\Files\dir.txt It will create a file named dir.txt in the Files folder, during compilation, with the list of files. 2. Click on the Sync button in the Files tab to add this file. Only required once. 3. To get the files at runtime: Code: Copy For Each f As String In File.ReadList(File.DirAssets, "dir.txt") Log(f) Next
A solution that will work in all modes: 1. Add to Main or B4XMainPage: Code: Copy #CustomBuildAction: folders ready, %WINDIR%\System32\cmd.exe, /c dir /b ..\Files\ > ..\Files\dir.txt It will create a file named dir.txt in the Files folder, during compilation, with the list of files. 2. Click on the Sync button in the Files tab to add this file. Only required once. 3. To get the files at runtime: Code: Copy For Each f As String In File.ReadList(File.DirAssets, "dir.txt") Log(f) Next
Daestrum Expert Licensed User Longtime User Sep 18, 2025 #5 Unfortunately I need a live list of files in assets while using pybridge so I can hot swap python code without restarting compile/run each time.
Unfortunately I need a live list of files in assets while using pybridge so I can hot swap python code without restarting compile/run each time.
kpmais Member Licensed User Longtime User Jan 16, 2026 #6 Erel, please, what does the parameter "folders ready" do?
aeric Expert Licensed User Longtime User Jan 17, 2026 #7 Daestrum said: Unfortunately I need a live list of files in assets while using pybridge so I can hot swap python code without restarting compile/run each time. Click to expand... How about put your files inside Objects folder?
Daestrum said: Unfortunately I need a live list of files in assets while using pybridge so I can hot swap python code without restarting compile/run each time. Click to expand... How about put your files inside Objects folder?
aeric Expert Licensed User Longtime User Jan 17, 2026 #8 kpmais said: Erel, please, what does the parameter "folders ready" do? Click to expand... Read: https://www.b4x.com/android/forum/threads/b4x-custombuildaction.168654/#content This is useful when you put common files in Shared Files folder which will copied to each platform during compilation.
kpmais said: Erel, please, what does the parameter "folders ready" do? Click to expand... Read: https://www.b4x.com/android/forum/threads/b4x-custombuildaction.168654/#content This is useful when you put common files in Shared Files folder which will copied to each platform during compilation.