stamp mismatch with notes file

Posted zhujiangm

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了stamp mismatch with notes file相关的知识,希望对你有一定的参考价值。

import os
import sys

def changeStamp(gcda: str, gcno: str):
    with open(gcda, 'rb+') as gcdaf:
        with open(gcno, 'rb+') as gcnof:
            gcdaf.seek(8)
            stamp = gcdaf.read(4)
            gcnof.seek(8)
            gcnof.write(stamp)

def walkdir(file):
    for root, dirs, files in os.walk(file):
        for f in files:
            fullname = os.path.join(root, f)
            ss=os.path.splitext(fullname)
            if ss[1] != ".gcno":
                continue

            if not (os.path.exists(ss[0] + ".gcno") and
                    os.path.exists(ss[0] + ".gcda")):
                continue

            changeStamp(
                    ss[0] + ".gcno",
                    ss[0] + ".gcda",
                    )
            print("deal: ", ss[0])

if __name__ == "__main__":
        argc = len(sys.argv)
        if argc < 2:
            print("Usage: " +
                    os.path.basename(sys.argv[0]) +
                    " path")
            sys.exit()
        walkdir(sys.argv[1])

以上是关于stamp mismatch with notes file的主要内容,如果未能解决你的问题,请参考以下文章

Closure call with mismatched arguments: function ‘routes.<anonymous closure>‘

Closure call with mismatched arguments: function ‘routes.<anonymous closure>‘

Multiple methods named 'status' found with mismatched result, parameter type or attributes(示

Keepalived_vrrp: one or more VIP associated with VRID mismatch actual MASTER advert

Keepalived_vrrp: one or more VIP associated with VRID mismatch actual MASTER advert

Deep learning III - II Machine Learning Strategy 2 - Bias and Variance with mismatched data distribu