36
36
int write_error(char* p) {
37
37
static FILE* f = 0;
39
f = fopen("../sample_results/errors", "a");
39
f = fopen(config.project_path("sample_results/errors"), "a");
40
40
if (!f) return ERR_FOPEN;
42
42
fprintf(f, "%s", p);
54
retval = boinc_mkdir("../sample_results");
54
retval = boinc_mkdir(config.project_path("sample_results"));
55
55
if (retval) return retval;
57
57
if (wu.canonical_resultid) {
58
58
vector<FILE_INFO> output_files;
59
const char *copy_path;
60
60
get_output_file_infos(canonical_result, output_files);
61
61
unsigned int n = output_files.size();
62
bool file_copied = false;
62
63
for (i=0; i<n; i++) {
63
64
FILE_INFO& fi = output_files[i];
65
sprintf(copy_path, "../sample_results/%s", wu.name);
66
copy_path = config.project_path("sample_results/%s", wu.name);
67
sprintf(copy_path, "../sample_results/%s_%d", wu.name, i);
68
copy_path = config.project_path("sample_results/%s_%d", wu.name, i);
69
70
retval = boinc_copy(fi.path.c_str() , copy_path);
70
if (retval && !fi.optional) {
71
sprintf(buf, "couldn't copy file %s\n", fi.path.c_str());
76
copy_path = config.project_path(
77
"sample_results/%s_%s", wu.name, "no_output_files"
79
FILE* f = fopen(copy_path, "w");
77
83
sprintf(buf, "%s: 0x%x\n", wu.name, wu.error_mask);
78
84
return write_error(buf);