Breadth-first search for files. Ensure that files will be found in the actual folder
or in the nearest subfolder in case the filename exists more than once.