MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / fcompare

Function fcompare

tools/python-3.11.9-amd64/Tools/scripts/ndiff.py:68–79  ·  view source on GitHub ↗
(f1name, f2name)

Source from the content-addressed store, hash-verified

66
67# open two files & spray the diff to stdout; return false iff a problem
68def fcompare(f1name, f2name):
69 f1 = fopen(f1name)
70 f2 = fopen(f2name)
71 if not f1 or not f2:
72 return 0
73
74 a = f1.readlines(); f1.close()
75 b = f2.readlines(); f2.close()
76 for line in difflib.ndiff(a, b):
77 print(line, end=' ')
78
79 return 1
80
81# crack args (sys.argv[1:] is normal) & compare;
82# return false iff a problem

Callers 1

mainFunction · 0.85

Calls 4

fopenFunction · 0.85
printFunction · 0.50
readlinesMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected