<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def register_file(self, filepath, creator, status=FileStatus.no_file, flags=FileFlags.no_flags):
 """Register a file in the archive. If the file already exists, this raises a `KeyError` Parameters filepath : str The path to the file creatror : int A unique key for the job that created this file status : `FileStatus` Enumeration giving current status of file flags : `FileFlags` Enumeration giving flags set on this file Returns `FileHandle` """

        # check to see if the file already exists
        try:
            file_handle = self.get_handle(filepath)
            raise KeyError("File %s already exists in archive" % filepath)
        except KeyError:
            pass
        localpath = self._get_localpath(filepath)
        if status == FileStatus.exists:
            # Make sure the file really exists
            fullpath = self._get_fullpath(filepath)
            if not os.path.exists(fullpath):
                print("register_file called on called on mising file %s" % fullpath)
                status = FileStatus.missing
                timestamp = 0
            else:
                timestamp = int(os.stat(fullpath).st_mtime)
        else:
            timestamp = 0
        key = len(self._table) + 1
        file_handle = FileHandle(path=localpath,
                                 key=key,
                                 creator=creator,
                                 timestamp=timestamp,
                                 status=status,
                                 flags=flags)
        file_handle.append_to_table(self._table)
        self._cache[localpath] = file_handle
        return file_handle