[lib] Iterate over each directory.