IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Dec 6, 2006, 12:44:53 PM (20 years ago)
Author:
eugene
Message:

added the append option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/cmd.data/write_vectors.c

    r7917 r10508  
    33int write_vectors (int argc, char **argv) {
    44 
     5  int append;
    56  int i, j, Nvec, Ne, N;
    67  FILE *f;
     
    1718  }
    1819
     20  append = FALSE;
     21  if ((N = get_argument (argc, argv, "-append"))) {
     22    remove_argument (N, &argc, argv);
     23    append = TRUE;
     24  }
     25
    1926  if (argc < 3) {
    20     gprint (GP_ERR, "USAGE: write [-f \"format\"] file vector vector ...\n");
     27    gprint (GP_ERR, "USAGE: write [-append] [-f \"format\"] file vector vector ...\n");
    2128    return (FALSE);
    2229  }
    2330
    2431  /* open file for outuput */
    25   f = fopen (argv[1], "w");
     32  if (append) {
     33      f = fopen (argv[1], "a");
     34  } else {
     35      f = fopen (argv[1], "w");
     36  }
    2637  if (f == (FILE *) NULL) {
    2738    gprint (GP_ERR, "can't open file for write\n");
Note: See TracChangeset for help on using the changeset viewer.