'Register the creation of all files during certbot execution.
Call this method before writing to the file to make sure that the
file will be cleaned up if the program exits unexpectedly.
(Before a save occurs)
:param bool temporary: If the file creation registry is for
a temp or permanent save.
:param \*files: file paths (str) to be registered
:raises certbot.errors.ReverterError: If
call does not contain necessary parameters or if the file creation
is unable to be registered.'

def register_file_creation(self, temporary, *files):

    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(path, 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()
