IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20532


Ignore:
Timestamp:
Nov 4, 2008, 4:27:55 PM (18 years ago)
Author:
eugene
Message:

need to remove existing output files(s)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/getstar/src/getstar.c

    r15743 r20532  
    2626  // this has to be here because the 'open' inits the catalog (perhaps not ideal)
    2727  if (!strcmp (OUTFORMAT, "CATALOG")) {
    28     unlink (OUTPUT);
    29     dvo_catalog_open   (&output, NULL, VERBOSE, "w");
     28      int length;
     29      char *filename, *path, *root;
     30      // we need to unlink the files, otherwise dvo_catalog_open ("w") will error if they exist
     31      unlink (output.filename);
     32      if (output.catmode == DVO_MODE_SPLIT) {
     33          path = pathname (output.filename);
     34          root = filerootname (output.filename);
     35          length = strlen(path) + strlen(root) + 6;
     36          ALLOCATE (filename, char, length);
     37          sprintf (filename, "%s/%s.cpm", path, root);
     38          unlink (filename);
     39          sprintf (filename, "%s/%s.cpn", path, root);
     40          unlink (filename);
     41          sprintf (filename, "%s/%s.cps", path, root);
     42          unlink (filename);
     43      }
     44      dvo_catalog_open   (&output, NULL, VERBOSE, "w");
    3045  }
    3146
Note: See TracChangeset for help on using the changeset viewer.