[Nitpick] FILEMAN:GetDirListing behaviour is different when the second argument is nil
Game Mode
None
Give an example of what is wrong
FILEMAN:GetDirListing( directory, nil, true ) doesn't return the same as FILEMAN:GetDirListing( directory, false, true ) Is that right?
Give an example of what it should look like
Maybe verify the behaviors when the 2nd and 3rd parameters are nil and if any is nil they should behave as false?
It's expected behavior, as RageFileManager already checks if the second argument isn't nil before even trying to check for the third argument. However, both the second and third argument are completely optional.
1 - Directory (string) 2 - Only Directories (boolean, has check if its not nil) 3 - Return Path too (boolean, depends if 2 is true)
It reports different values given that the second value is trying to look for a boolean value, but can mercifully skip it with that nil check present on the function.
As an example:
FILEMAN:GetDirListing('/Appearance/NoteSkins/dance/outfox-note-3D/', nil, true)
2nd argument is nil, thus its check is skipped, and so is the third, as that check is nested on the second argument condition.
{
1 = _Outfox HexMine.txt
2 = _Outfox Lift.txt
3 = _Outfox Material.txt
4 = _Outfox Note.txt
5 = Down Tap Lift.lua
6 = Down Tap Mine.lua
7 = Down Tap Note.lua
8 = metrics.ini
9 = Textures
}
FILEMAN:GetDirListing('/Appearance/NoteSkins/dance/outfox-note-3D/', false, true)
This returns the full paths for the items as the third argument is true, and the second one happened to be a valid boolean, so it could proceed to check.
{
1 = /Appearance/NoteSkins/dance/outfox-note-3D/_Outfox HexMine.txt
2 = /Appearance/NoteSkins/dance/outfox-note-3D/_Outfox Lift.txt
3 = /Appearance/NoteSkins/dance/outfox-note-3D/_Outfox Material.txt
4 = /Appearance/NoteSkins/dance/outfox-note-3D/_Outfox Note.txt
5 = /Appearance/NoteSkins/dance/outfox-note-3D/Down Tap Lift.lua
6 = /Appearance/NoteSkins/dance/outfox-note-3D/Down Tap Mine.lua
7 = /Appearance/NoteSkins/dance/outfox-note-3D/Down Tap Note.lua
8 = /Appearance/NoteSkins/dance/outfox-note-3D/metrics.ini
9 = /Appearance/NoteSkins/dance/outfox-note-3D/Textures
}
FILEMAN:GetDirListing('/Appearance/NoteSkins/dance/outfox-note-3D/', true, true)
As the purpose of the second argument is to only report directories, now the result is only one folder, and its full path since the third argument is true.
{
1 = /Appearance/NoteSkins/dance/outfox-note-3D/Textures
}
I see, thanks for explaining it. It's a little confusing seeing it at first if the argument is nil when it expects a boolean, so that's 3 different outputs. It would be good to document this.