list the files using a sink
when scanning the directory emit end-of-directory events
move path to a new header