3 ms·
The unix filesystem API doesn't let you "give me a list of all files in this directory matching this pattern". Nor does it let you start iterating through a di
by londons_explore 4y ago
The unix filesystem API doesn't let you "give me a list of all files in this directory matching this pattern".
Nor does it let you start iterating through a directory with getdents(), then pause, then come back to iterate the rest of the files later. You have to receive every file name in the order the OS wants to give them to you.
That prevents applications really being able to make use of clever storage mechanisms - you can never find the most recent 3 files in a big directory with anything cheaper than a linear scan.