Index: /trunk/ppImage/src/ppImageStatsOutput.c
===================================================================
--- /trunk/ppImage/src/ppImageStatsOutput.c	(revision 18060)
+++ /trunk/ppImage/src/ppImageStatsOutput.c	(revision 18061)
@@ -43,5 +43,5 @@
 
     // convert to a real UNIX filename
-    psString resolved = pmConfigConvertFilename(statsName, config, true); // Resolved filename
+    psString resolved = pmConfigConvertFilename(statsName, config, true, false); // Resolved filename
     FILE *statsFile = fopen (resolved, "w");
     if (!statsFile) {
Index: /trunk/ppMerge/src/ppMerge.c
===================================================================
--- /trunk/ppMerge/src/ppMerge.c	(revision 18060)
+++ /trunk/ppMerge/src/ppMerge.c	(revision 18061)
@@ -73,5 +73,5 @@
     psString statsName = psMetadataLookupStr(&mdok, config->arguments, "STATS.NAME"); // Statistics file name
     if (mdok && statsName && strlen(statsName) > 0) {
-        psString resolved = pmConfigConvertFilename(statsName, config, true); // Resolved filename
+        psString resolved = pmConfigConvertFilename(statsName, config, true, false); // Resolved filename
         FILE *statsFile = fopen(resolved, "w"); // Output statistics file
         if (!statsFile) {
Index: /trunk/ppNorm/src/ppNormCalc.c
===================================================================
--- /trunk/ppNorm/src/ppNormCalc.c	(revision 18060)
+++ /trunk/ppNorm/src/ppNormCalc.c	(revision 18061)
@@ -38,5 +38,5 @@
 
     if (argc >= 2) {
-        psString resolved = pmConfigConvertFilename(argv[1], config, false); // Resolved filename
+        psString resolved = pmConfigConvertFilename(argv[1], config, false, false); // Resolved filename
         inFile = fopen(resolved, "r");
         if (!inFile) {
@@ -48,5 +48,5 @@
     }
     if (argc == 3) {
-        psString resolved = pmConfigConvertFilename(argv[2], config, true); // Resolved filename
+        psString resolved = pmConfigConvertFilename(argv[2], config, true, false); // Resolved filename
         outFile = fopen(resolved, "w");
         if (!outFile) {
Index: /trunk/ppStack/src/ppStackLoop.c
===================================================================
--- /trunk/ppStack/src/ppStackLoop.c	(revision 18060)
+++ /trunk/ppStack/src/ppStackLoop.c	(revision 18061)
@@ -148,5 +148,5 @@
     assert(image);
 
-    psString resolved = pmConfigConvertFilename(name, config, true); // Resolved file name
+    psString resolved = pmConfigConvertFilename(name, config, true, true); // Resolved file name
     psFits *fits = psFitsOpen(resolved, "w");
     if (!fits) {
@@ -189,5 +189,5 @@
     FILE *statsFile = NULL;             // File stream for statistics
     if (statsName && strlen(statsName) > 0) {
-        psString resolved = pmConfigConvertFilename(statsName, config, true); // Resolved filename
+        psString resolved = pmConfigConvertFilename(statsName, config, true, true); // Resolved filename
         statsFile = fopen(resolved, "w");
         if (!statsFile) {
@@ -401,7 +401,7 @@
             }
             // Resolved names
-            psString imageResolved = pmConfigConvertFilename(imageNames->data[i], config, false);
-            psString maskResolved = pmConfigConvertFilename(maskNames->data[i], config, false);
-            psString weightResolved = pmConfigConvertFilename(weightNames->data[i], config, false);
+            psString imageResolved = pmConfigConvertFilename(imageNames->data[i], config, false, false);
+            psString maskResolved = pmConfigConvertFilename(maskNames->data[i], config, false, false);
+            psString weightResolved = pmConfigConvertFilename(weightNames->data[i], config, false, false);
             imageFits->data[i] = psFitsOpen(imageResolved, "r");
             maskFits->data[i] = psFitsOpen(maskResolved, "r");
@@ -625,7 +625,7 @@
             weightFits->data[i] = NULL;
             if (tempDelete) {
-                psString imageResolved = pmConfigConvertFilename(imageNames->data[i], config, false);
-                psString maskResolved = pmConfigConvertFilename(maskNames->data[i], config, false);
-                psString weightResolved = pmConfigConvertFilename(weightNames->data[i], config, false);
+                psString imageResolved = pmConfigConvertFilename(imageNames->data[i], config, false, false);
+                psString maskResolved = pmConfigConvertFilename(maskNames->data[i], config, false, false);
+                psString weightResolved = pmConfigConvertFilename(weightNames->data[i], config, false, false);
                 if (unlink(imageResolved) == -1 || unlink(maskResolved) == -1 ||
                     unlink(weightResolved) == -1) {
Index: /trunk/ppStats/src/ppStats.c
===================================================================
--- /trunk/ppStats/src/ppStats.c	(revision 18060)
+++ /trunk/ppStats/src/ppStats.c	(revision 18061)
@@ -27,5 +27,5 @@
     if (argc == 2) {
         outName = argv[1];
-        psString resolved = pmConfigConvertFilename(outName, config, true); // Resolved filename
+        psString resolved = pmConfigConvertFilename(outName, config, true, false); // Resolved filename
 
         if (resolved && strlen(resolved) > 0) {
Index: /trunk/ppStats/src/ppStatsSetupFromArgs.c
===================================================================
--- /trunk/ppStats/src/ppStatsSetupFromArgs.c	(revision 18060)
+++ /trunk/ppStats/src/ppStatsSetupFromArgs.c	(revision 18061)
@@ -147,5 +147,5 @@
     int result = PS_EXIT_UNKNOWN_ERROR;
     {
-        psString resolved = pmConfigConvertFilename(inName, config, false); // Resolved filename
+        psString resolved = pmConfigConvertFilename(inName, config, false, false); // Resolved filename
         data->fits = psFitsOpen(resolved, "r");
         if (!data->fits) {
Index: /trunk/psModules/src/camera/pmFPAfileDefine.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 18060)
+++ /trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 18061)
@@ -457,5 +457,5 @@
 
     // this function is implicitly an INPUT operation: do not create the file
-    psString realName = pmConfigConvertFilename (infiles->data[0], config, false);
+    psString realName = pmConfigConvertFilename (infiles->data[0], config, false, false);
     if (!realName) {
         psError(PS_ERR_IO, false, "Failed to convert file name %s\n", (char *) infiles->data[0]);
@@ -538,5 +538,5 @@
         if (i > 0) {
             // this function is implicitly an INPUT operation: do not create the file
-            psString realName = pmConfigConvertFilename (infiles->data[i], config, false);
+            psString realName = pmConfigConvertFilename (infiles->data[i], config, false, false);
             if (!realName) {
                 psError(PS_ERR_IO, false, "Failed to convert file name %s", (char *) infiles->data[i]);
@@ -672,5 +672,5 @@
     for (int i = 0; i < infiles->n; i++) {
         // this function is implicitly an INPUT operation: do not create the file
-        psString realName = pmConfigConvertFilename (infiles->data[i], config, false);
+        psString realName = pmConfigConvertFilename (infiles->data[i], config, false, false);
         if (!realName) {
             psError(PS_ERR_IO, false, "Failed to convert file name %s", (char *) infiles->data[i]);
@@ -925,5 +925,5 @@
     // Prepend the global path to the file rule
     // this function is implicitly an INPUT operation: do not create the file
-    psString tmpName = pmConfigConvertFilename(file->filerule, config, false);
+    psString tmpName = pmConfigConvertFilename(file->filerule, config, false, false);
     psFree (file->filerule);
     file->filerule = tmpName;
Index: /trunk/psModules/src/camera/pmFPAfileIO.c
===================================================================
--- /trunk/psModules/src/camera/pmFPAfileIO.c	(revision 18060)
+++ /trunk/psModules/src/camera/pmFPAfileIO.c	(revision 18061)
@@ -752,5 +752,5 @@
     // apply filename mangling rules (file://, path://, neb://)
     bool create = file->mode == PM_FPA_MODE_WRITE ? true : false;
-    psString tmpName = pmConfigConvertFilename (file->filename, config, create);
+    psString tmpName = pmConfigConvertFilename (file->filename, config, create, false);
     psFree (file->filename);
     file->filename = tmpName;
Index: /trunk/psModules/src/config/pmConfig.c
===================================================================
--- /trunk/psModules/src/config/pmConfig.c	(revision 18060)
+++ /trunk/psModules/src/config/pmConfig.c	(revision 18061)
@@ -556,5 +556,5 @@
         }
         if (logDest) {
-            psString resolved = pmConfigConvertFilename(logDest, config, true); // Resolved filename
+            psString resolved = pmConfigConvertFilename(logDest, config, true, false); // Resolved filename
             if (!resolved || strlen(resolved) == 0) {
                 psWarning("Unable to resolve log destination: %s --- ignored", logDest);
@@ -614,5 +614,5 @@
         }
         if (traceDest) {
-            psString resolved = pmConfigConvertFilename(traceDest, config, true); // Resolved filename
+            psString resolved = pmConfigConvertFilename(traceDest, config, true, false); // Resolved filename
             if (!resolved || strlen(resolved) == 0) {
                 psWarning("Unable to resolve trace destination: %s --- ignored", traceDest);
@@ -1490,5 +1490,5 @@
 
 // convert the supplied name, create a new output psString
-psString pmConfigConvertFilename(const char *filename, const pmConfig *config, bool create)
+psString pmConfigConvertFilename(const char *filename, const pmConfig *config, bool create, bool truncate)
 {
     PS_ASSERT_STRING_NON_EMPTY(filename, NULL);
Index: /trunk/psModules/src/config/pmConfig.h
===================================================================
--- /trunk/psModules/src/config/pmConfig.h	(revision 18060)
+++ /trunk/psModules/src/config/pmConfig.h	(revision 18061)
@@ -5,6 +5,6 @@
  *  @author Eugene Magnier, IfA
  *
- *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-06-09 00:38:42 $
+ *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-06-10 20:28:25 $
  *  Copyright 2005-2006 Institute for Astronomy, University of Hawaii
  */
@@ -163,5 +163,6 @@
     const char *filename,               ///< file path/URI
     const pmConfig *config,             ///< configuration
-    bool create                         ///< create the file if it doesn't exist
+    bool create,                        ///< create the file if it doesn't exist
+    bool truncate                       ///< truncate the file (if it exists)
 );
 
Index: /trunk/psastro/src/psastroLoadRefstars.c
===================================================================
--- /trunk/psastro/src/psastroLoadRefstars.c	(revision 18060)
+++ /trunk/psastro/src/psastroLoadRefstars.c	(revision 18061)
@@ -42,5 +42,5 @@
 
     // convert the uri to a real filename (ie, path://foobar) 
-    psString CATDIR = pmConfigConvertFilename(catdir, config, false); // Resolved filename
+    psString CATDIR = pmConfigConvertFilename(catdir, config, false, false); // Resolved filename
     PS_ASSERT (CATDIR, NULL);
 
Index: /trunk/psastro/src/psastroMetadataStats.c
===================================================================
--- /trunk/psastro/src/psastroMetadataStats.c	(revision 18060)
+++ /trunk/psastro/src/psastroMetadataStats.c	(revision 18061)
@@ -45,5 +45,5 @@
 
     // convert to a real UNIX filename
-    psString resolved = pmConfigConvertFilename(filename, config, true); // Resolved filename
+    psString resolved = pmConfigConvertFilename(filename, config, true, false); // Resolved filename
     FILE *statsFile = fopen (resolved, "w");
     if (!statsFile) {
Index: /trunk/pswarp/src/pswarpDefineSkycell.c
===================================================================
--- /trunk/pswarp/src/pswarpDefineSkycell.c	(revision 18060)
+++ /trunk/pswarp/src/pswarpDefineSkycell.c	(revision 18061)
@@ -38,5 +38,5 @@
 
     // this function is implicitly an INPUT operation: do not create the file
-    psString realName = pmConfigConvertFilename (infiles->data[0], config, false);
+    psString realName = pmConfigConvertFilename (infiles->data[0], config, false, false);
     if (!realName) {
         psError(PS_ERR_IO, false, "Failed to convert file name %s\n", (char *) infiles->data[0]);
Index: /trunk/pswarp/src/pswarpLoop.c
===================================================================
--- /trunk/pswarp/src/pswarpLoop.c	(revision 18060)
+++ /trunk/pswarp/src/pswarpLoop.c	(revision 18061)
@@ -103,5 +103,5 @@
     FILE *statsFile = NULL;             // File stream for statistics
     if (mdok && statsName && strlen(statsName) > 0) {
-        psString resolved = pmConfigConvertFilename(statsName, config, true);
+        psString resolved = pmConfigConvertFilename(statsName, config, true, false);
         statsFile = fopen(resolved, "w");
         if (!statsFile) {
