'Return a coverage results file in path.'

def write_results_file(self, path, lines, lnotab, lines_hit):

    try:
        outfile = open(path, 'w')
    except IOError as err:
        print >>sys.stderr, ('trace:    Could    not    open    %r    for    writing:    %s-    skipping' % (path, err))
        return (0, 0)
    n_lines = 0
    n_hits = 0
    for (i, line) in enumerate(lines):
        lineno = (i + 1)
        if (lineno in lines_hit):
            outfile.write(('%5d:    ' % lines_hit[lineno]))
            n_hits += 1
            n_lines += 1
        elif rx_blank.match(line):
            outfile.write('                            ')
        elif ((lineno in lnotab) and (PRAGMA_NOCOVER not in lines[i])):
            outfile.write('>>>>>>    ')
            n_lines += 1
        else:
            outfile.write('                            ')
        outfile.write(lines[i].expandtabs(8))
    outfile.close()
    return (n_hits, n_lines)
