IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 28, 2006, 2:13:41 PM (20 years ago)
Author:
eugene
Message:

adding stdout, stderr task commands

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/CheckJobs.c

    r8129 r9037  
    33int CheckJobs () {
    44
     5  FILE *f;
    56  Job *job;
    67  Macro *macro;
     
    3132        PushNamedQueue ("stdout", job[0].stdout.buffer);
    3233        PushNamedQueue ("stderr", job[0].stderr.buffer);
     34
     35        /* save the stdout and stderr if desired */
     36        if (job[0].stdout_dump != NULL) {
     37          f = fopen (job[0].stdout_dump, "a");
     38          if (f == NULL) {
     39            gprint (GP_ERR, "unable to open stdout dump file %s\n", job[0].stdout_dump);
     40          } else {
     41            fwrite (job[0].stdout.buffer, 1, job[0].stdout.Nbuffer, f);
     42            fclose (f);
     43          }
     44        }
     45        if (job[0].stderr_dump != NULL) {
     46          f = fopen (job[0].stderr_dump, "a");
     47          if (f == NULL) {
     48            gprint (GP_ERR, "unable to open stderr dump file %s\n", job[0].stderr_dump);
     49          } else {
     50            fwrite (job[0].stderr.buffer, 1, job[0].stderr.Nbuffer, f);
     51            fclose (f);
     52          }
     53        }
    3354
    3455        /* set taskarg variables */
Note: See TracChangeset for help on using the changeset viewer.