def files_equal(name1, name2):
if not os.path.exists(name1):<EOL><INDENT>print("<STR_LIT>" + name1, file=sys.stderr)<EOL>return False<EOL><DEDENT>if not os.path.exists(name2):<EOL><INDENT>print("<STR_LIT>" + name2, file=sys.stderr)<EOL>return False<EOL><DEDENT>file1 = open(name1)<EOL>file2 = open(name2)<EOL>content1 = file1.read()<EOL>content2 = file2.read()<EOL>file1.close()<EOL>file2.close()<EOL>return content1.strip() == content2.strip()<EOL>
Compares two files. Returns True if their content matches