Reconstruct the directory structure