Index: /trunk/psLib/src/astro/psTime.c
===================================================================
--- /trunk/psLib/src/astro/psTime.c	(revision 4943)
+++ /trunk/psLib/src/astro/psTime.c	(revision 4944)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.68 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-31 22:28:35 $
+ *  @version $Revision: 1.69 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-02 21:32:03 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1360,5 +1360,6 @@
 }
 
-psTime* psTimeFromISO(const char *input)
+psTime* psTimeFromISO(const char *input,
+                      psTimeType type)
 {
     psS32 millisecond;
@@ -1391,4 +1392,5 @@
     outTime = p_psTimeFromTM(&tmTime);
     outTime->nsec = millisecond * 1000000;
+    outTime->type = type;
 
     return outTime;
Index: /trunk/psLib/src/astro/psTime.h
===================================================================
--- /trunk/psLib/src/astro/psTime.h	(revision 4943)
+++ /trunk/psLib/src/astro/psTime.h	(revision 4944)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.37 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-31 22:28:35 $
+ *  @version $Revision: 1.38 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-02 21:32:03 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -281,5 +281,6 @@
  */
 psTime* psTimeFromISO(
-    const char* input                  ///< Input time to be converted.
+    const char* input,                 ///< Input time to be converted.
+    psTimeType type                    ///< Time type.
 );
 
Index: /trunk/psLib/src/math/psMinimize.c
===================================================================
--- /trunk/psLib/src/math/psMinimize.c	(revision 4943)
+++ /trunk/psLib/src/math/psMinimize.c	(revision 4944)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.132 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-30 01:14:13 $
+ *  @version $Revision: 1.133 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-02 21:32:06 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -2192,9 +2192,10 @@
 
     if (psTraceGetLevel (".psLib.dataManip.VectorFitPolynomial1DOrd") >= 5) {
-        FILE *f = psTraceGetDestination ();
+        FILE *f = fdopen((psTraceGetDestination ()), "a+");
         fprintf (f, "VectorFitPolynomial1D()\n");
         for (int i = 0; i < x->n; i++) {
             fprintf (f, "(x, y, yErr) is (%f, %f, %f)\n", x->data.F64[i], y->data.F64[i], yErr->data.F64[i]);
         }
+        fclose(f);
     }
 
Index: /trunk/psLib/src/mathtypes/psImage.c
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.c	(revision 4943)
+++ /trunk/psLib/src/mathtypes/psImage.c	(revision 4944)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.79 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-31 02:07:11 $
+ *  @version $Revision: 1.80 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-02 21:32:06 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -473,7 +473,8 @@
 }
 
-bool p_psImagePrint (FILE *f, psImage *a, char *name)
-{
-
+bool p_psImagePrint (int fd, psImage *a, char *name)
+{
+    FILE *f;
+    f = fdopen(fd, "a+");
     fprintf (f, "matrix: %s\n", name);
 
@@ -485,4 +486,5 @@
     }
     fprintf (f, "\n");
+    fclose(f);
     return (true);
 }
Index: /trunk/psLib/src/mathtypes/psImage.h
===================================================================
--- /trunk/psLib/src/mathtypes/psImage.h	(revision 4943)
+++ /trunk/psLib/src/mathtypes/psImage.h	(revision 4944)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.65 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-31 02:07:11 $
+ *  @version $Revision: 1.66 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-02 21:32:06 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -239,5 +239,5 @@
  */
 bool p_psImagePrint(
-    FILE *f,                           ///< Destination stream
+    int fd,                            ///< Destination file descriptor
     psImage *a,                        ///< image to print
     char *name                         ///< name of the image (for title)
Index: /trunk/psLib/src/mathtypes/psVector.c
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.c	(revision 4943)
+++ /trunk/psLib/src/mathtypes/psVector.c	(revision 4944)
@@ -9,6 +9,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2005-08-30 01:14:13 $
+*  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2005-09-02 21:32:06 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -599,9 +599,10 @@
 }
 
-bool p_psVectorPrint (FILE *f,
+bool p_psVectorPrint (int fd,
                       psVector *a,
                       char *name)
 {
-
+    FILE *f;
+    f = fdopen(fd, "a+");
     fprintf (f, "vector: %s\n", name);
 
@@ -610,4 +611,5 @@
     }
     fprintf (f, "\n");
+    fclose(f);
     return (true);
 }
Index: /trunk/psLib/src/mathtypes/psVector.h
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.h	(revision 4943)
+++ /trunk/psLib/src/mathtypes/psVector.h	(revision 4944)
@@ -11,6 +11,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.42 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-08-30 01:14:13 $
+ *  @version $Revision: 1.43 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-02 21:32:06 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -192,5 +192,5 @@
  */
 bool p_psVectorPrint (
-    FILE *f,                           ///< output stream
+    int fd,                            ///< output file descriptor
     psVector *a,                       ///< vector to print
     char *name                         ///< name of vector (for title)
Index: /trunk/psLib/src/sys/psTrace.c
===================================================================
--- /trunk/psLib/src/sys/psTrace.c	(revision 4943)
+++ /trunk/psLib/src/sys/psTrace.c	(revision 4944)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-18 20:54:22 $
+ *  @version $Revision: 1.56 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-02 21:32:06 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -55,4 +55,5 @@
 static p_psComponent* cRoot = NULL; // The root of the trace component
 static FILE *traceFP = NULL;        // File destination for messages.
+//static int traceFD = 0;
 
 static void componentFree(p_psComponent* comp);
@@ -525,32 +526,46 @@
 
 // XXX EAM : I've added code to close the old traceFP (safely)
-void psTraceSetDestination(FILE * fp)
-{
-
-    bool special;
-
-    // XXX EAM perhaps return an error?
-    if (fp == NULL) {
+void psTraceSetDestination(int fd)
+{
+
+
+    /*
+        bool special;
+     
+        // XXX EAM perhaps return an error?
+        if (fp == NULL) {
+            return;
+        }
+     
+        // cannot close traceFP if one of the special FILE ptrs
+        special  = (traceFP == NULL);
+        special |= (traceFP == stdin);
+        special |= (traceFP == stdout);
+        special |= (traceFP == stderr);
+     
+        if (!special) {
+            fclose (traceFP);
+        }
+        traceFP = fp;
+    */
+    if (fd == -1) {
         return;
     }
-
-    // cannot close traceFP if one of the special FILE ptrs
-    special  = (traceFP == NULL);
-    special |= (traceFP == stdin);
-    special |= (traceFP == stdout);
-    special |= (traceFP == stderr);
-
-    if (!special) {
-        fclose (traceFP);
-    }
-    traceFP = fp;
-}
-
-FILE *psTraceGetDestination()
-{
-    if (traceFP == NULL) {
+    if (fd == 1) {
         traceFP = stdout;
-    }
-    return traceFP;
+    } else if (fd == 2) {
+        traceFP = stderr;
+    } else if (fd == 0) {
+        traceFP = stdin;
+    } else if (fd > 2) {
+        traceFP = fdopen(fd, "w");
+    }
+}
+
+int psTraceGetDestination()
+{
+    int fd;
+    fd = fileno(traceFP);
+    return fd;
 }
 
Index: /trunk/psLib/src/sys/psTrace.h
===================================================================
--- /trunk/psLib/src/sys/psTrace.h	(revision 4943)
+++ /trunk/psLib/src/sys/psTrace.h	(revision 4944)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.35 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-26 00:44:44 $
+ *  @version $Revision: 1.36 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-09-02 21:32:06 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -106,5 +106,5 @@
 /// Set the destination of future trace messages.
 void psTraceSetDestination(
-    FILE * fp                          ///< Pointer to file
+    int fd                             ///< File descriptor
 );
 
@@ -113,5 +113,5 @@
  *  @return FILE*:      File Destination
  */
-FILE *psTraceGetDestination(void);
+int psTraceGetDestination(void);
 
 /* \} */// End of SystemGroup Functions
Index: /trunk/psLib/test/astro/tst_psTime_01.c
===================================================================
--- /trunk/psLib/test/astro/tst_psTime_01.c	(revision 4943)
+++ /trunk/psLib/test/astro/tst_psTime_01.c	(revision 4944)
@@ -23,6 +23,6 @@
  *  @author  Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.1 $  $Name: not supported by cvs2svn $
- *  @date  $Date: 2005-07-13 02:46:58 $
+ *  @version $Revision: 1.2 $  $Name: not supported by cvs2svn $
+ *  @date  $Date: 2005-09-02 21:32:06 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -636,5 +636,5 @@
     // Attempt to convert NULL string
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate error message for NULL ISO string");
-    time = psTimeFromISO(NULL);
+    time = psTimeFromISO(NULL, PS_TIME_TAI);
     if(time != NULL) {
         psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected for NULL ISO string");
@@ -643,5 +643,5 @@
 
     // Convert valid ISO string
-    time = psTimeFromISO(testTime1Str);
+    time = psTimeFromISO(testTime1Str, PS_TIME_TAI);
     if(time->type != PS_TIME_TAI) {
         psError(PS_ERR_UNKNOWN,true,"Type %d not as expected %d",
@@ -658,5 +658,5 @@
     // Attempt to convert invalid ISO string
     psLogMsg(__func__,PS_LOG_INFO,"Following should generate an error for invalid ISO string");
-    time = psTimeFromISO("Here I am");
+    time = psTimeFromISO("Here I am", PS_TIME_TAI);
     if(time != NULL) {
         psError(PS_ERR_UNKNOWN,true,"Did not return NULL as expected for invalid ISO string");
Index: /trunk/psLib/test/sys/tst_psTrace.c
===================================================================
--- /trunk/psLib/test/sys/tst_psTrace.c	(revision 4943)
+++ /trunk/psLib/test/sys/tst_psTrace.c	(revision 4944)
@@ -8,4 +8,6 @@
 #include "pslib_strict.h"
 #include "psTest.h"
+#include <fcntl.h>
+#include <unistd.h>
 
 
@@ -49,5 +51,6 @@
     psS32 lev = 0;
 
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
 
     for (i=0;i<10;i++) {
@@ -96,5 +99,6 @@
 static psS32 testTrace01(void)
 {
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
     (void)psTraceSetLevel(".A.B.C.D.E", 5);
 
@@ -111,5 +115,6 @@
 {
     psTraceReset();
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
     psTraceSetLevel(".A.B", 2);
     psTraceSetLevel(".A.B.C.D.E", 5);
@@ -142,5 +147,6 @@
     psS32 lev = 0;
 
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
 
     for (i=0;i<10;i++) {
@@ -183,16 +189,21 @@
 {
     FILE *fp;
+    int FD;
     psS32 nb = 0;
-
-    fp = fopen("tst_psTrace02_OUT", "w");
+    FD = creat("tst_psTrace02_OUT", 0666);
+    //    printf("\nFD = %d\n", FD);
+    //    fp = fopen("tst_psTrace02_OUT", "w");
+    fp = fdopen(FD, "w");
     for (nb = 0 ; nb<4;nb++) {
         if (nb == 0)
-            psTraceSetDestination(stdout);
+            //            psTraceSetDestination(stdout);
+            psTraceSetDestination(1);
         if (nb == 1)
-            psTraceSetDestination(stderr);
+            //            psTraceSetDestination(stderr);
+            psTraceSetDestination(2);
         if (nb == 2)
-            psTraceSetDestination(NULL);
+            psTraceSetDestination(-1); //NULL
         if (nb == 3)
-            psTraceSetDestination(fp);
+            psTraceSetDestination(FD);
 
         (void)psTraceSetLevel(".", 4);
@@ -221,4 +232,5 @@
 
     fclose(fp);
+    close(FD);
 
     return(0);
@@ -227,5 +239,6 @@
 static psS32 testTrace05(void)
 {
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
 
     (void)psTraceSetLevel(".", 9);
@@ -277,5 +290,6 @@
 static psS32 testTrace06(void)
 {
-    psTraceSetDestination(stderr);
+    //    psTraceSetDestination(stderr);
+    psTraceSetDestination(2);
 
     (void)psTraceSetLevel(".", 9);
