Edit directory structure for detach.