Given an array of paths find required file by searching directories from first to last.