- Timestamp:
- 06/24/10 07:51:15 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Chief/Chief.cc
r218 r229 14 14 #define SERVER_NAME "Chief" 15 15 #include "Evidence.h" 16 17 using namespace std; 16 18 17 19 // ========= Class Declarations ========= … … 38 40 39 41 DimService *LastRunNumber; 40 char *RunNumFilename;42 string RunNumFilename; 41 43 int RunNumber; 42 44 }; … … 70 72 71 73 // Open file containing last run number 72 FILE *RunNumFile = fopen(Chief->RunNumFilename , "r+");74 FILE *RunNumFile = fopen(Chief->RunNumFilename.c_str(), "r+"); 73 75 if(RunNumFile == NULL) { 74 Chief->Message(Chief->ERROR, "Could not open file '%s' that contains the last run number (%s)", Chief->RunNumFilename , strerror(errno));76 Chief->Message(Chief->ERROR, "Could not open file '%s' that contains the last run number (%s)", Chief->RunNumFilename.c_str(), strerror(errno)); 75 77 OK = false; 76 78 } … … 78 80 // Read last run number 79 81 if(fscanf(RunNumFile,"%d", &RunNumber) != 1 ) { 80 Chief->Message(Chief->ERROR, "Could not read run number from file '%s'", Chief->RunNumFilename );82 Chief->Message(Chief->ERROR, "Could not read run number from file '%s'", Chief->RunNumFilename.c_str()); 81 83 OK = false; 82 84 } … … 86 88 rewind(RunNumFile); 87 89 if(OK && fprintf(RunNumFile,"%.8u ",RunNumber) < 0) { 88 Chief->Message(Chief->ERROR, "Could not write to run number file '%s'", Chief->RunNumFilename );90 Chief->Message(Chief->ERROR, "Could not write to run number file '%s'", Chief->RunNumFilename.c_str()); 89 91 OK = false; 90 92 } … … 92 94 // Close run number file 93 95 if(fclose(RunNumFile) != 0) { 94 Chief->Message(Chief->ERROR, "Could not close run number file '%s'", Chief->RunNumFilename );96 Chief->Message(Chief->ERROR, "Could not close run number file '%s'", Chief->RunNumFilename.c_str()); 95 97 OK = false; 96 98 }
Note:
See TracChangeset
for help on using the changeset viewer.