Reconstructing the directory structure