- Timestamp:
- Aug 16, 2018, 8:00:56 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/prototype-v0/zoo-project/zoo-kernel/service_internal_hpc.c
r862 r877 50 50 return; 51 51 } 52 if(*s==NULL || (*s)->outputs==NULL ){52 if(*s==NULL || (*s)->outputs==NULL || (*s)->content==NULL){ 53 53 return; 54 54 } … … 621 621 fprintf(scriptFile,"\n"); 622 622 fprintf(scriptFile,"echo \"Job finished at: $(date)\"\n"); 623 map* footerMap=getMapFromMaps(*main_conf,configurationId,"jobscript_footer"); 624 if(footerMap!=NULL){ 625 // Use the footer file if defined in the HPC section of the main.cfg file 626 struct stat f_status; 627 int s=stat(footerMap->value, &f_status); 628 if(s==0){ 629 char* fcontent=(char*)malloc(sizeof(char)*(f_status.st_size+1)); 630 FILE* f=fopen(footerMap->value,"rb"); 631 fread(fcontent,f_status.st_size,1,f); 632 int fsize=f_status.st_size; 633 fcontent[fsize]=0; 634 fclose(f); 635 char* ffcontent=(char*)malloc((strlen(fcontent)+(3*strlen(uuid->value))+1)*sizeof(char)); 636 sprintf(ffcontent,fcontent,uuid->value,uuid->value,uuid->value); 637 fprintf(scriptFile,"%s\n### --- ZOO-Service FOOTER end --- ###\n\n",ffcontent); 638 free(fcontent); 639 }else 640 fprintf(scriptFile,"### *** Default ZOO-Service FOOTER (footer file failed to load) *** ###\n\n"); 641 }else 642 fprintf(scriptFile,"### *** Default ZOO-Service FOOTER (no footer found) *** ###\n\n"); 623 643 fflush(scriptFile); 624 644 fclose(scriptFile);
Note: See TracChangeset
for help on using the changeset viewer.