reconstruct directory structure