Added preservation of file permissions.