What I'm looking for is a how to build a function that takes a child folder an loops through it and backwards in the directory hierarchy to find the first matching file that is specified.
A example is that i lets say i have the directory structure: Home / Folder 1 / Folder 2 / Folder 3
And I'm looking for the file style.css.
I would like to start pointing to the child folder (Folder 3) and look for the style.css and if it's not there it would continue to the parent folder (Folder 2) and so on. But it should not go further back than Folder 1.
If anybody have a good idea how do to this I would be very grateful!