3 * Utility routines used by the MOIRA extraction programs.
5 * (c) Copyright 1988 by the Massachusetts Institute of Technology.
6 * For copying and distribution information, please see the file
11 #include <mit-copyright.h>
15 #include <moira_site.h>
21 char oldfile[64], filename[64];
23 sprintf(oldfile, "%s.old", targetfile);
24 sprintf(filename, "%s~", targetfile);
25 if (rename(targetfile, oldfile) == 0) {
26 if (rename(filename, targetfile) < 0) {
27 rename(oldfile, targetfile);
28 perror("Unable to install new file (rename failed)\n");
29 fprintf(stderr, "Filename = %s\n", targetfile);
33 if (rename(filename, targetfile) < 0) {
34 perror("Unable to rename old file\n");
35 fprintf(stderr, "Filename = %s\n", targetfile);
67 com_err(whoami, MR_INGRES_ERR, " code %d\n", code);
68 if (code == -49900 || code == -37000 || code == 17700)
70 critical_alert("DCM", "%s build encountered DATABASE ERROR %d",