

def register_file_creation(self, temporary, *files):
    'Register the creation of all files during certbot execution.\n\n        Call this method before writing to the file to make sure that the\n        file will be cleaned up if the program exits unexpectedly.\n        (Before a save occurs)\n\n        :param bool temporary: If the file creation registry is for\n            a temp or permanent save.\n        :param \\*files: file paths (str) to be registered\n\n        :raises certbot.errors.ReverterError: If\n            call does not contain necessary parameters or if the file creation\n            is unable to be registered.\n\n        '
    if (not files):
        raise errors.ReverterError('Forgot to provide files to registration call')
    cp_dir = self._get_cp_dir(temporary)
    new_fd = None
    try:
        (new_fd, ex_files) = self._read_and_append(os.path.join(cp_dir, 'NEW_FILES'))
        for path in files:
            if (path not in ex_files):
                new_fd.write('{0}{1}'.format(cp_dir, os.linesep))
    except (IOError, OSError):
        logger.error('Unable to register file creation(s) - %s', files)
        raise errors.ReverterError('Unable to register file creation(s) - {0}'.format(files))
    finally:
        if (new_fd is not None):
            new_fd.close()

dataset/ETHPy150Open letsencrypt/letsencrypt/certbot/reverter.py Reverter.register_file_creation/VarMisuse@98/359 `path`->`cp_dir`