IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 31, 2013, 5:31:39 AM (13 years ago)
Author:
eugene
Message:

merge changes from EAM branch (medianfilter list error; handle empty kapa message; add join and vlist cmds, match2d help, excel-style lists: foo:A equiv to foo:0, time-based dvo temp-file purging, fix avmatch parallel coordlist bug, sub-pixel resolve sersic model, dgaussjordan needs larger dynamic range, avextract psfqf, psfqfperf, stargal)

Location:
trunk/Ohana
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana

  • trunk/Ohana/src/opihi

  • trunk/Ohana/src/opihi/dvo/hosts.c

    r35757 r36084  
    1212    gprint (GP_ERR, "  commands:\n");
    1313    gprint (GP_ERR, "    purge-temp : delete all tempfiles for this shell\n");
    14     gprint (GP_ERR, "               : [-old-pid] [-all-pid] [-v] [-verbose] [-commit] [-type type]\n");
     14    gprint (GP_ERR, "               : [-old-pid] [-all-pid] [-v] [-verbose] [-commit] [-type type] [-age hours]\n");
    1515    gprint (GP_ERR, "    get-results : determine name of RESULTS file\n");
    1616    return FALSE;
     
    3333    }
    3434   
     35    struct timeval now;
     36    gettimeofday (&now, NULL);
     37
     38    float AGE = 0;
     39    int NOW = now.tv_sec;
     40    if ((N = get_argument (argc, argv, "-age"))) {
     41      remove_argument (N, &argc, argv);
     42      AGE = atof(argv[N]);
     43      remove_argument (N, &argc, argv);
     44    }
     45
    3546    int VERBOSE = FALSE;
    3647    if ((N = get_argument (argc, argv, "-v"))) {
     
    121132      glob (name, 0, NULL, &pglob);
    122133      int j;
     134      struct stat filestats;
    123135      for (j = 0; j < pglob.gl_pathc; j++) {
     136        if (AGE > 0) {
     137          if (stat(pglob.gl_pathv[j], &filestats)) {
     138            gprint (GP_ERR, "failed to get stats for %s\n", pglob.gl_pathv[j]);
     139            continue;
     140          }
     141          float myAge = (NOW - filestats.st_mtime) / 3600.0;
     142          if (myAge < AGE) continue;
     143        }
    124144        if (VERBOSE) gprint (GP_ERR, "unlink %s\n", pglob.gl_pathv[j]);
    125145        if (!DRYRUN) unlink (pglob.gl_pathv[j]);
Note: See TracChangeset for help on using the changeset viewer.