write_if_different¶
- extension_helpers.write_if_different(filename, data)¶
Write
datatofilename, if the content of the file is different.This can be useful if e.g. generating
.cor.hfiles, to make sure that Python does not re-build unchanged files.- Parameters:
filename (str or
pathlib.Path) – The file name to be written to.data (bytes) – The data to be written to
filename.