Recursively reads the contents of a directory.