Get an object representation of a directory structure.