S Sub7 Active Member Licensed User Longtime User Feb 18, 2015 #1 Hello, i need to get the number of file in some folders manually moved to file.dirassets in future releases is i may need to add some more files, i'd like to avoid to correct all the code by updating the default values. Code: Copy Dim fileCount As List fileCount = File.ListFiles(File.DirAssets) 'OK fileCount = File.ListFiles(File.DirAssets&"/foldername") 'NOT OK 'error java.io.IOException: AssetsDir/foldername is not a folder. Log(fileCount.Size) Code: Copy 'Bad code Dim numfiles as int = 50 'I know the total number of files in file.dirassets/foldername if counter <= 50 Then.... 'I prefer if counter <= filecount.size Then.... any walktrought?
Hello, i need to get the number of file in some folders manually moved to file.dirassets in future releases is i may need to add some more files, i'd like to avoid to correct all the code by updating the default values. Code: Copy Dim fileCount As List fileCount = File.ListFiles(File.DirAssets) 'OK fileCount = File.ListFiles(File.DirAssets&"/foldername") 'NOT OK 'error java.io.IOException: AssetsDir/foldername is not a folder. Log(fileCount.Size) Code: Copy 'Bad code Dim numfiles as int = 50 'I know the total number of files in file.dirassets/foldername if counter <= 50 Then.... 'I prefer if counter <= filecount.size Then.... any walktrought?
Erel B4X founder Staff member Licensed User Longtime User Feb 18, 2015 #2 File.ListFiles doesn't work with subfolders inside the assets folder. Upvote 0