readdir on a directory, and then generate tasks for each sub directory