Corrected codegen to use CreateOrTruncate for generated files