Bug? File.ListFiles(File.DirAssets) different behaviour B4A / BaJ - klaus    
Feb 12, 2020   
(4 reactions)There is a difference between B4A and B4J with File.ListFiles(File.DirAssets).
This code works in B4A but not in B4J:
For Each FileName As String In File.ListFiles(File.DirAssets)
This code works in...
link: There is no bug here.
As the documentation in B4J says File.ListFiles doesn't support listing...
link:
So, the system behind should handle this difference and not oblige the user to take care of it, wel...
link: life.
In our case, there are two possibilities: File.DirAssets or "../files/".
So...
B4A Question File.ListFiles(File.Assets) in Debug - lip    
Sep 21, 2021.
'Get files from Tablet
Dim AssetFiles As List
AssetFiles = File.ListFiles(File.DirAssets... there are 21 files found by ListFiles. However, if compile in debug there are 32 files. The additional...
link: the list of files you need to use in that text document. Then your app can open the (known) text...
link:
How did the files get into that directory? Where did they come from? And how did you know...
link: I am
This works, unless I am lost also:
For Each f As String In File.ListFiles(File.DirAssets...
B4A Question [Solved] ExternalStorage.ListFiles behaving unexpectedly - agraham    
Dec 16, 2018 Long UK.jpg
ListFiles =Lat Long UK.jpg
for a known file
/storage/0000-0000/Maps OS 1000K/Lat Long... FindFile and ListFiles are looking in this folder and not the expected one. If I set filename to...
link: ListFiles "For Each f As JavaObject In files" uses the same JavaObject instance, "f"...
link: This is a workaround for the unexpected behaviour in ListFiles. Each ExternalFile in the returned...
link: We are having phone/Inernet problems so if I don't respond I'm not deliberately ignoring you...
B4A Question File.ListFiles usage - Erel (first post)    
Aug 12, 2025You can use ExternalStorage or ContentChooser to access those files. See the link above....
link: Thanks. I'm a newbie, so I might ask silly questions. I need to edit some files in the internal...
link: You can remove the permission from the manifest editor. It will not be granted by the OS.
Options f...
link: mylist As List = File.ListFiles("/storage/emulated/0/Android/media/com.whatsapp/WhatsApp...
B4A Code Snippet [B4X] CopyFolder / DeleteFolder / RecursiveList - Erel    
Oct 19, 2025   
(26 reactions), targetFolder As String)
If File.Exists(targetFolder, "") = False Then File.MakeDir(targetFolder, "")
For Each f As String In File.ListFiles(Source)
If File.IsDirectory(Source, f) Then
CopyFolder(File.Combine(Source, f), File.Combine(targetFolder, f))
Continue... As String In File.ListFiles(folder)
If File.IsDirectory(folder, f) Then
DeleteFolder... As List)
For Each f As String In File.ListFiles(File.Combine(Root, Folder))
Result.Add(File...
B4A Question file.listfiles not working. only returns one file - apti (first post)    
Jan 29, 2025found it. had to request permission to read and now I get what I expected. I think we need a better ...
link: but not seeing where I would be able to choose a folder from the users file area. I just want to get...
link: You cannot access the external storage directly. You need to use ContentChooser or ExternalStorage.
...
link:
No one should use ListView.
What is the output of:
Log(MusicFolder)
Log(File.ListFiles...
B4i Question [SOLVED?] Bug in File.ListFiles in Release mode - JackKirk    
May 6, 2017 Sub
Private Sub Page1_Resize(Width As Int, Height As Int)
Private wrk_files As List
Private wrk_str As String
Private wrk_ptr As Int
'Get names of files in assets directory
wrk_files = File.ListFiles(File.DirAssets)
'For all files...
For wrk_ptr = 0 To...
link: You shouldn't use File.ListFiles with the assets folder. I will add a note about it in...
link: ).
You shouldn't use File.ListFiles with the assets folder. I will add a note about it in...
B4A Question File.ListFiles only listing folders - Luthier (first post)    
Dec 18, 2023Thank you Erel.
Not sending it to Google Play and App now showing files having set targetSdkVersion to 28....
link: The problem is not in File.ListFiles. As @DonManfred wrote, the only accessible path is XUI...
link: File.ListFiles(dir) or the async version.)...
link: File.DirRootExternal-Paths...
B4J Question Resumable subs with recursive File.ListFiles to update UI - walt61    
Jun 3, 2017 As String)
LabelFolder.Text = fldr ' Show this folder
For Each x In File.ListFiles(fldr)
If File.IsDirectory(fldr, x) Then
GetTheFolderContents(File.Combine(fldr, x... after returning from a subfolder
Else
fList.Add(File.Combine(fldr, x)) '...
link: Thanks for your help guys;
@LucaMs : that was the first thing I tried as it looked straightforward, but the recursion seemed to thro...
link: :${flist.Size}"$
Sleep(0)
Dim entries As List = File.ListFiles(fldr)
If entries...
B4A Question File.DirRootExternal and ListFiles not working - Scantech    
Aug 28, 2020TargetSDKVersion 29 and Android-29 does not work with l1.AddAll(File.ListFiles(File.DirRootExternal))
We can't populate list in File.DirRootExternal. Is there anyway to populate the list from...
link: Please do not make duplicate threads....
link: Oh, now I gotcha.
Maybe this might help:
https://www.b4x.com/android/forum/threads/externalstorage...
link: have the complete error message right now. I substitute file.dirrootexternal for file.internal and works...
Page: 1  
2  
3  
4  
5  
6  
7