LittleFS list directory in alphabetical order
Posted: Fri Mar 22, 2024 12:04 pm
Dear forum
Got an application in which I need to list the files and directories now and then.
Currently I am using a recursive function that iterates over the files and directories in the order LittlFS finds these. However, I want it to be a bit more fancy like so:
/dir1
/dir2
/dir...
afile1
bfile2
cfile3
..
zfile
In words: The list should first list all the directories and then the files in the current directory in alphabetical order.
I searched for such a function but came up empty.
I guess this question both applies to ESP8266 as ESP32.
Thanks...
Got an application in which I need to list the files and directories now and then.
Currently I am using a recursive function that iterates over the files and directories in the order LittlFS finds these. However, I want it to be a bit more fancy like so:
/dir1
/dir2
/dir...
afile1
bfile2
cfile3
..
zfile
In words: The list should first list all the directories and then the files in the current directory in alphabetical order.
I searched for such a function but came up empty.
I guess this question both applies to ESP8266 as ESP32.
Thanks...