Given a filename, say foo.txt and a base directory URL, say ~/bar/directory what's the way to find the subdirectory for the first occurrence of the file in a BFS manner?
i.e. given a directory structure of
/bar
/directory
/subdirectory
bar.txt
foo.txt
Match foo.txt before going down the /directory path.
The only API for file traversal I have found does DFS, see `NSFileManager.enumeratorAtURL:includingPropertiesForKeys:options:errorHandler:.