- }
- else {
- char *fname = malloc(strlen(output_name) + 32);
-
- sprintf(fname, "%s.dat", output_name);
- ranges_ofp = fopen(fname, "w");
- if (ranges_ofp == NULL) {
- perror(fname);
- exit(1);
- }
- if (verbose)
- printf("Sending range data to %s\n", fname);
-
- sprintf(fname, "%s.avg", output_name);
- avgs_ofp = fopen(fname, "w");
- if (avgs_ofp == NULL) {
- perror(fname);
- exit(1);
- }
- if (verbose)
- printf("Sending stats data to %s\n", fname);
-
+ } else {
+ rngs_ofp = std_open(output_name, "dat", "range data");
+ avgs_ofp = std_open(output_name, "avg", "stats data");
+ msgs_ofp = std_open(output_name, "msg", "K messages");