iterates over files and dirs together