Index: /trunk/psastro/src/psastroDefineFiles.c
===================================================================
--- /trunk/psastro/src/psastroDefineFiles.c	(revision 14211)
+++ /trunk/psastro/src/psastroDefineFiles.c	(revision 14212)
@@ -4,8 +4,12 @@
 
     // these calls bind the I/O handle to the specified fpa
-    if (!pmFPAfileDefineOutput (config, input->fpa, "PSASTRO.OUTPUT")) {
+    pmFPAfile *output = NULL;
+
+    output = pmFPAfileDefineOutput (config, input->fpa, "PSASTRO.OUTPUT");
+    if (!output) {
 	psError(PSASTRO_ERR_CONFIG, false, "Failed to build FPA from PSASTRO.INPUT");
 	return false;
     }
+    output->save = true;
 
 # if (0)
Index: /trunk/psphot/src/psphotDefineFiles.c
===================================================================
--- /trunk/psphot/src/psphotDefineFiles.c	(revision 14211)
+++ /trunk/psphot/src/psphotDefineFiles.c	(revision 14212)
@@ -16,8 +16,10 @@
 
     // the output sources are carried on the input->fpa structures
-    if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT")) {
+    pmFPAfile *outsources = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.OUTPUT");
+    if (!outsources) {
         psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.OUTPUT");
         return false;
     }
+    outsources->save = true;
 
     // if we are choosing not to save the output detections, mark this file inactive so it will
@@ -25,12 +27,15 @@
     if (!psMetadataLookupBool (NULL, recipe, "SAVE.OUTPUT")) {
         pmFPAfileActivate (config->files, false, "PSPHOT.OUTPUT");
+	outsources->save = false;
     }
 
     // optionally save the residual image
     if (psMetadataLookupBool(NULL, recipe, "SAVE.RESID")) {
-        if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID")) {
+        pmFPAfile *output = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.RESID");
+	if (!output) {
             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.RESID");
             return false;
         }
+	output->save = true;
     }
     // optionally save the background model (small FITS image)
@@ -38,8 +43,10 @@
         int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");
         int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");
-        if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL")) {
+        pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL");
+	if (!output) {
             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL");
             return false;
         }
+	output->save = true;
     }
     // optionally save the background model's standard deviation (small FITS image)
@@ -47,29 +54,37 @@
         int DX = psMetadataLookupS32 (&status, recipe, "BACKGROUND.XBIN");
         int DY = psMetadataLookupS32 (&status, recipe, "BACKGROUND.YBIN");
-        if (!pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL.STDEV")) {
+        pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa, DX, DY, "PSPHOT.BACKMDL.STDEV");
+	if (!output) {
             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKMDL.STDEV");
             return false;
         }
+	output->save = true;
     }
     // optionally save the full background image
     if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKGND")) {
-        if (!pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKGND")) {
+        pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKGND");
+	if (!output) {
             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.BACKGND");
             return false;
         }
+	output->save = true;
     }
     // optionally save the background-subtracted image
     if (psMetadataLookupBool(NULL, recipe, "SAVE.BACKSUB")) {
-        if (!pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKSUB")) {
+        pmFPAfile *output = pmFPAfileDefineFromFPA (config, input->fpa,  1,  1, "PSPHOT.BACKSUB");
+	if (!output) {
             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.");
             return false;
         }
+	output->save = true;
     }
     // optionally save the PSF Model
     if (psMetadataLookupBool(NULL, recipe, "SAVE.PSF")) {
-        if (!pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE")) {
+        pmFPAfile *output = pmFPAfileDefineOutput (config, input->fpa, "PSPHOT.PSF.SAVE");
+	if (!output) {
             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for PSPHOT.PSF.SAVE");
             return false;
         }
+	output->save = true;
     }
 
@@ -77,16 +92,23 @@
     // allow specific plots only
     if (psMetadataLookupBool(NULL, recipe, "SAVE.PLOTS")) {
-        if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS")) {
+	pmFPAfile *output = NULL;
+        output = pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.MOMENTS");
+	if (!output) {
             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.MOMENTS");
             return false;
         }
-        if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL")) {
+	output->save = true;
+        output = pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.PSFMODEL");
+	if (!output) {
             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.PSFMODEL");
             return false;
         }
-        if (!pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.APRESID")) {
+	output->save = true;
+        output = pmFPAfileDefineOutput (config, input->fpa, "SOURCE.PLOT.APRESID");
+	if (!output) {
             psError(PSPHOT_ERR_CONFIG, false, "Cannot find a rule for SOURCE.PLOT.APRESID");
             return false;
         }
+	output->save = true;
     }
 
