<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def fix_header_comment(filename, timestamp):
 """Fixes the header-comment of the given file."""

    # Fix input file.
    name = os.path.basename( filename )
    for line in fileinput.input( filename, inplace=1, mode="rU" ):
        # If header-comment already contains anything for '$Id$', remove it.
        line = re.sub(r'\$Id:[^$]+\$', r'$Id$', line.rstrip())
        # Replace '$Id$' by a string containing the file's name (and a timestamp)!
        line = re.sub(re.escape(r'$Id$'), r'$Id: ' + name + r' ' + timestamp.isoformat() + r' $', line.rstrip())
        print(line)