IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18061


Ignore:
Timestamp:
Jun 10, 2008, 10:28:59 AM (18 years ago)
Author:
jhoblitt
Message:

add truncate parameter to pmConfigConvertFilename()

Location:
trunk
Files:
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppImage/src/ppImageStatsOutput.c

    r14000 r18061  
    4343
    4444    // convert to a real UNIX filename
    45     psString resolved = pmConfigConvertFilename(statsName, config, true); // Resolved filename
     45    psString resolved = pmConfigConvertFilename(statsName, config, true, false); // Resolved filename
    4646    FILE *statsFile = fopen (resolved, "w");
    4747    if (!statsFile) {
  • trunk/ppMerge/src/ppMerge.c

    r17227 r18061  
    7373    psString statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS.NAME"); // Statistics file name
    7474    if (mdok && statsName && strlen(statsName) > 0) {
    75         psString resolved = pmConfigConvertFilename(statsName, config, true); // Resolved filename
     75        psString resolved = pmConfigConvertFilename(statsName, config, true, false); // Resolved filename
    7676        FILE *statsFile = fopen(resolved, "w"); // Output statistics file
    7777        if (!statsFile) {
  • trunk/ppNorm/src/ppNormCalc.c

    r13231 r18061  
    3838
    3939    if (argc >= 2) {
    40         psString resolved = pmConfigConvertFilename(argv[1], config, false); // Resolved filename
     40        psString resolved = pmConfigConvertFilename(argv[1], config, false, false); // Resolved filename
    4141        inFile = fopen(resolved, "r");
    4242        if (!inFile) {
     
    4848    }
    4949    if (argc == 3) {
    50         psString resolved = pmConfigConvertFilename(argv[2], config, true); // Resolved filename
     50        psString resolved = pmConfigConvertFilename(argv[2], config, true, false); // Resolved filename
    5151        outFile = fopen(resolved, "w");
    5252        if (!outFile) {
  • trunk/ppStack/src/ppStackLoop.c

    r18030 r18061  
    148148    assert(image);
    149149
    150     psString resolved = pmConfigConvertFilename(name, config, true); // Resolved file name
     150    psString resolved = pmConfigConvertFilename(name, config, true, true); // Resolved file name
    151151    psFits *fits = psFitsOpen(resolved, "w");
    152152    if (!fits) {
     
    189189    FILE *statsFile = NULL;             // File stream for statistics
    190190    if (statsName && strlen(statsName) > 0) {
    191         psString resolved = pmConfigConvertFilename(statsName, config, true); // Resolved filename
     191        psString resolved = pmConfigConvertFilename(statsName, config, true, true); // Resolved filename
    192192        statsFile = fopen(resolved, "w");
    193193        if (!statsFile) {
     
    401401            }
    402402            // Resolved names
    403             psString imageResolved = pmConfigConvertFilename(imageNames->data[i], config, false);
    404             psString maskResolved = pmConfigConvertFilename(maskNames->data[i], config, false);
    405             psString weightResolved = pmConfigConvertFilename(weightNames->data[i], config, false);
     403            psString imageResolved = pmConfigConvertFilename(imageNames->data[i], config, false, false);
     404            psString maskResolved = pmConfigConvertFilename(maskNames->data[i], config, false, false);
     405            psString weightResolved = pmConfigConvertFilename(weightNames->data[i], config, false, false);
    406406            imageFits->data[i] = psFitsOpen(imageResolved, "r");
    407407            maskFits->data[i] = psFitsOpen(maskResolved, "r");
     
    625625            weightFits->data[i] = NULL;
    626626            if (tempDelete) {
    627                 psString imageResolved = pmConfigConvertFilename(imageNames->data[i], config, false);
    628                 psString maskResolved = pmConfigConvertFilename(maskNames->data[i], config, false);
    629                 psString weightResolved = pmConfigConvertFilename(weightNames->data[i], config, false);
     627                psString imageResolved = pmConfigConvertFilename(imageNames->data[i], config, false, false);
     628                psString maskResolved = pmConfigConvertFilename(maskNames->data[i], config, false, false);
     629                psString weightResolved = pmConfigConvertFilename(weightNames->data[i], config, false, false);
    630630                if (unlink(imageResolved) == -1 || unlink(maskResolved) == -1 ||
    631631                    unlink(weightResolved) == -1) {
  • trunk/ppStats/src/ppStats.c

    r14020 r18061  
    2727    if (argc == 2) {
    2828        outName = argv[1];
    29         psString resolved = pmConfigConvertFilename(outName, config, true); // Resolved filename
     29        psString resolved = pmConfigConvertFilename(outName, config, true, false); // Resolved filename
    3030
    3131        if (resolved && strlen(resolved) > 0) {
  • trunk/ppStats/src/ppStatsSetupFromArgs.c

    r17985 r18061  
    147147    int result = PS_EXIT_UNKNOWN_ERROR;
    148148    {
    149         psString resolved = pmConfigConvertFilename(inName, config, false); // Resolved filename
     149        psString resolved = pmConfigConvertFilename(inName, config, false, false); // Resolved filename
    150150        data->fits = psFitsOpen(resolved, "r");
    151151        if (!data->fits) {
  • trunk/psModules/src/camera/pmFPAfileDefine.c

    r18035 r18061  
    457457
    458458    // this function is implicitly an INPUT operation: do not create the file
    459     psString realName = pmConfigConvertFilename (infiles->data[0], config, false);
     459    psString realName = pmConfigConvertFilename (infiles->data[0], config, false, false);
    460460    if (!realName) {
    461461        psError(PS_ERR_IO, false, "Failed to convert file name %s\n", (char *) infiles->data[0]);
     
    538538        if (i > 0) {
    539539            // this function is implicitly an INPUT operation: do not create the file
    540             psString realName = pmConfigConvertFilename (infiles->data[i], config, false);
     540            psString realName = pmConfigConvertFilename (infiles->data[i], config, false, false);
    541541            if (!realName) {
    542542                psError(PS_ERR_IO, false, "Failed to convert file name %s", (char *) infiles->data[i]);
     
    672672    for (int i = 0; i < infiles->n; i++) {
    673673        // this function is implicitly an INPUT operation: do not create the file
    674         psString realName = pmConfigConvertFilename (infiles->data[i], config, false);
     674        psString realName = pmConfigConvertFilename (infiles->data[i], config, false, false);
    675675        if (!realName) {
    676676            psError(PS_ERR_IO, false, "Failed to convert file name %s", (char *) infiles->data[i]);
     
    925925    // Prepend the global path to the file rule
    926926    // this function is implicitly an INPUT operation: do not create the file
    927     psString tmpName = pmConfigConvertFilename(file->filerule, config, false);
     927    psString tmpName = pmConfigConvertFilename(file->filerule, config, false, false);
    928928    psFree (file->filerule);
    929929    file->filerule = tmpName;
  • trunk/psModules/src/camera/pmFPAfileIO.c

    r18028 r18061  
    752752    // apply filename mangling rules (file://, path://, neb://)
    753753    bool create = file->mode == PM_FPA_MODE_WRITE ? true : false;
    754     psString tmpName = pmConfigConvertFilename (file->filename, config, create);
     754    psString tmpName = pmConfigConvertFilename (file->filename, config, create, false);
    755755    psFree (file->filename);
    756756    file->filename = tmpName;
  • trunk/psModules/src/config/pmConfig.c

    r18036 r18061  
    556556        }
    557557        if (logDest) {
    558             psString resolved = pmConfigConvertFilename(logDest, config, true); // Resolved filename
     558            psString resolved = pmConfigConvertFilename(logDest, config, true, false); // Resolved filename
    559559            if (!resolved || strlen(resolved) == 0) {
    560560                psWarning("Unable to resolve log destination: %s --- ignored", logDest);
     
    614614        }
    615615        if (traceDest) {
    616             psString resolved = pmConfigConvertFilename(traceDest, config, true); // Resolved filename
     616            psString resolved = pmConfigConvertFilename(traceDest, config, true, false); // Resolved filename
    617617            if (!resolved || strlen(resolved) == 0) {
    618618                psWarning("Unable to resolve trace destination: %s --- ignored", traceDest);
     
    14901490
    14911491// convert the supplied name, create a new output psString
    1492 psString pmConfigConvertFilename(const char *filename, const pmConfig *config, bool create)
     1492psString pmConfigConvertFilename(const char *filename, const pmConfig *config, bool create, bool truncate)
    14931493{
    14941494    PS_ASSERT_STRING_NON_EMPTY(filename, NULL);
  • trunk/psModules/src/config/pmConfig.h

    r17992 r18061  
    55 *  @author Eugene Magnier, IfA
    66 *
    7  *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2008-06-09 00:38:42 $
     7 *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2008-06-10 20:28:25 $
    99 *  Copyright 2005-2006 Institute for Astronomy, University of Hawaii
    1010 */
     
    163163    const char *filename,               ///< file path/URI
    164164    const pmConfig *config,             ///< configuration
    165     bool create                         ///< create the file if it doesn't exist
     165    bool create,                        ///< create the file if it doesn't exist
     166    bool truncate                       ///< truncate the file (if it exists)
    166167);
    167168
  • trunk/psastro/src/psastroLoadRefstars.c

    r18045 r18061  
    4242
    4343    // convert the uri to a real filename (ie, path://foobar)
    44     psString CATDIR = pmConfigConvertFilename(catdir, config, false); // Resolved filename
     44    psString CATDIR = pmConfigConvertFilename(catdir, config, false, false); // Resolved filename
    4545    PS_ASSERT (CATDIR, NULL);
    4646
  • trunk/psastro/src/psastroMetadataStats.c

    r18007 r18061  
    4545
    4646    // convert to a real UNIX filename
    47     psString resolved = pmConfigConvertFilename(filename, config, true); // Resolved filename
     47    psString resolved = pmConfigConvertFilename(filename, config, true, false); // Resolved filename
    4848    FILE *statsFile = fopen (resolved, "w");
    4949    if (!statsFile) {
  • trunk/pswarp/src/pswarpDefineSkycell.c

    r18006 r18061  
    3838
    3939    // this function is implicitly an INPUT operation: do not create the file
    40     psString realName = pmConfigConvertFilename (infiles->data[0], config, false);
     40    psString realName = pmConfigConvertFilename (infiles->data[0], config, false, false);
    4141    if (!realName) {
    4242        psError(PS_ERR_IO, false, "Failed to convert file name %s\n", (char *) infiles->data[0]);
  • trunk/pswarp/src/pswarpLoop.c

    r17955 r18061  
    103103    FILE *statsFile = NULL;             // File stream for statistics
    104104    if (mdok && statsName && strlen(statsName) > 0) {
    105         psString resolved = pmConfigConvertFilename(statsName, config, true);
     105        psString resolved = pmConfigConvertFilename(statsName, config, true, false);
    106106        statsFile = fopen(resolved, "w");
    107107        if (!statsFile) {
Note: See TracChangeset for help on using the changeset viewer.