![]() |
loadSubFolders(str, int);
I would like to request this EXTREMELY useful function. As of now, I can load a folder's content with loadFolder(str, int); - but that's it. If I have a lot of dynamically created folders (which I do) as subfolders to a folder, there is no way I can find them out at the moment - without resorting to saving the name of each created folder in an array (heaven forbid).
This function would only list the name of the subfolders to the folder sent as parameter. Example: PHP Code:
PHP Code:
So pwetty pwease, can this be added? :cry: *begs* |
Can't you just do loadfolder([str]startfolder,[bool]recursive) and make recursive true? Recursive should grab every single file starting from start folder then all subfolders until it gets everything.
|
Didn't work when I tried it, so I doubt it.
|
PHP Code:
|
Quote:
PHP Code:
PHP Code:
|
Loading the files in subfolders works flawlessly for my by setting the second parameter to true.
|
Quote:
|
Quote:
|
Were you trying it with a file extension? Because, it's when you do that you need that extra /*.
|
Quote:
I've just always run my own check (file.ends( ".txt" )) |
Quote:
|
Folders don't end in .ini so why would they show up?
|
Quote:
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Quote:
|
Its a simple concept, loadfolder() will only include filenames that fit the wildcard. So obviously if you do loadfolder("levels/*.nw", 0); its only gonna include nw files in the array, there is no need to use variable.ends() to check extension unless you're dealing with more than one or something. If dealing with more than one it would probably be easier to use more than one loadfolder with different extensions.
Zero I don't think you understand how the function is working. |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
Quote:
Honestly, did you even read what I said? I know it is working for you. I was explaining why your first method was not working for you. I have perfect understanding of loadfolder() and am not arguing how it should and shouldn't work. I was simply pointing out the flaws in your original post as to why it wouldn't work for you. |
Quote:
|
Quote:
|
Quote:
|
Quote:
|
All times are GMT +2. The time now is 08:22 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.