********> bugfix.27 Author: Bill Ross Date: 6/28/95 Programs: Carnal Severity: Moderate Problem: When using the -O[verwrite] option, mdcrd output files get appended rather than overwriting existing ones. Cause: Insufficient thought when adding the -O option. Fix: Make the following change to coord.c: ------------------------------------------------------------------ *** OLD coord.c --- NEW coord.c *************** *** 133,139 exit(1); if ((crdptr->idunion.crd.file = ! fopen(crdptr->idunion.crd.name, "a+")) == NULL){ perror(crdptr->idunion.crd.name); exit(1); } --- 133,140 ----- exit(1); if ((crdptr->idunion.crd.file = ! fopen(crdptr->idunion.crd.name, (append ? "a+" : "w"))) ! == NULL){ perror(crdptr->idunion.crd.name); exit(1); } *************** *** 137,143 perror(crdptr->idunion.crd.name); exit(1); } ! if (!exists) fprintf(crdptr->idunion.crd.file, "CARNAL dump\n"); } } --- 138,144 ----- perror(crdptr->idunion.crd.name); exit(1); } ! if (!exists || !append) fprintf(crdptr->idunion.crd.file, "CARNAL dump\n"); } } *************** *** 608,614 return; } } - /* * set passed all tests: add it into average or print it */ --- 609,614 ----- return; } } /* * set passed all tests: add it into average or print it */ ------------------------------------------------------------------ Temporary workarounds: Remove .crd output files by hand before running when not wanting to append. Routines affected: COORD --