Search code examples
iphoneobjective-cwildcardnsfilemanager

NSFileManager: Using wildcards to navigate directories


Hey, I need to be able to navigate in a directory structure like eg; '/folder/folder2/gehrjne/folder3'

With 'folder2' containing a bunch of random folder names like 'gehrjne', yet I need to get to eg, folder3.

Using a * in a path doesn't seem to work in NSFileManager for some reason. Just says there is no directory of such.

Thanks.


Solution

  • you'll have to get the directory's contents, perhaps recursively, then find what you're after from the results -- it doesn't work like a regex.