Many methods of reading from the file system using the NSFileManager and lower-level APIs in iOS involve built-in caching, so reading from directories that have not been changed can be quite fast, even if there are a lot of items in directories.
I have a situation where I want to be able to list files in a directory using glob:
i.e. the folder has files named like this:
1-1-0.png 1-2-0.png 1-3-0.png 1-3-1.png 2-2-1.png 5-1-1.png 5-1-2.png 5-2-1.png 5-3-0.png 6-1-1.png ... 1501-5-2.png
I would like to get all the file names corresponding to 5-*-1.png , which will return me 5-1-1.png and 5-2-1.png .
Downloading the full list of directories and then doing the substitution in RAM is quite simple, but is there any way to do this at the OS level, which will have built-in caching, so repeated calls to the same glob will give caching (faster) results?
source share