File search

Good day. I have question.
Is it true that
music__18.jpg
music__2.jpg
always will be found in that order on all systems?
Or it is platform depended?

The problem is that on my machine the order is lexicographic. But on other windows computer music__2.jpg founded before music__18.jpg.

No, it’s totally unpredictable. You’d have to sort it yourself if you need a particular order.

When jules says unpredictable, it really is. Take a db style filesystem (or close enough, like NTFS), it is stored based on how its hash algorythm works. Most others store using a linked-list based on when it was put in. It will be different everywhere, possible everytime you run your program…

I agree about DB. But JUCE use native windows file’s search algoritm as I understand.

And as stated, the OS’s file function can return the files in any order.

Thanks for explanation. It’s clear for me now.