read_next function

Loop through paths to find a file