only rewrite files if something changed.