reconstruct the whole directory structure.