Mateocedillo Posted April 29, 2022 Posted April 29, 2022 (edited) Hello! I am needing help with this. It happens that I want to browse files, but they are in subfolders with different names. My question is how can I examine all the subfolders that are in that folder? I will explain: I'm just making a plug-in system for some software, and I need to examine the manifest files. The structure of the folders is like this, we are going to start from the main folder of the script. Plug-ins folder: The folder where plug-ins created by users are stored. plug-ins\dictionaries subfolder: The folder that contains the files for this plug-in. Another subfolder, plug-ins\test: a template for making your plug-ins. And so if you are going to create more future plug-ins there are more subfolders that you don't know the name of. What I want to do is to analyze, from the plug-ins folder, all the manifests that are in the subfolders. I made this code, and when I put it to the test (in debugging with a script that calls the function with a MSGBox) it returns 0, which means that there is an error finding the files. By the way, I used wildcards and searched on the internet, for example: Plug-ins\**\information.ini but it doesn't work. I hope you can help me. I leave the code: Func ScanAddOnInfos() $hFiles = FileFindFirstFile(@ScriptDir & "\plug-ins\information.ini") If $hFiles = -1 Then Return 0 Local $sFileName = "", $aResult[] While 1 $aResult[] = FileRead(FileOpen($sFileName, $FO_READ)) $sFileName = FileFindNextFile($hFiles) If @error Then ExitLoop Sleep(50) WEnd Return $aResult EndFunc Edited April 29, 2022 by Mateocedillo
Solution Subz Posted April 29, 2022 Solution Posted April 29, 2022 Why can't you use _FileListToArrayRec (@ScriptDir & "\Plug-ins", "information.ini", 1, 1, 1, 2) then loop through the results? Musashi 1
Mateocedillo Posted April 30, 2022 Author Posted April 30, 2022 On 4/28/2022 at 10:19 PM, Subz said: Why can't you use _FileListToArrayRec (@ScriptDir & "\Plug-ins", "information.ini", 1, 1, 1, 2) then loop through the results? Hello, Thanks for your answer. Yes, it has indeed worked.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now