File search


#1

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?


#2

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


#3

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


#4

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…


#5

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


#6

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


#7

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


#8