Index: /trunk/psLib/src/types/psMetadataConfig.c
===================================================================
--- /trunk/psLib/src/types/psMetadataConfig.c	(revision 8818)
+++ /trunk/psLib/src/types/psMetadataConfig.c	(revision 8819)
@@ -10,6 +10,6 @@
 *  @author Eric Van Alst, MHPCC
 *
-*  @version $Revision: 1.85 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-09-12 21:55:49 $
+*  @version $Revision: 1.86 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-09-16 01:07:38 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1157,6 +1157,4 @@
     PS_ASSERT_PTR_NON_NULL(filename,NULL);
 
-    struct stat buf;
-
     // Attempt to open specified file
     int fd = 0;
@@ -1164,4 +1162,11 @@
         // XXX really should return strerror() here
         psError(PS_ERR_IO, true, _("Failed to open file '%s'. Check if it exists and it has the proper permissions."), filename);
+        return NULL;
+    }
+
+    struct stat buf;                    // Results of stat() for file
+    if (fstat(fd, &buf) != 0) {
+        psError(PS_ERR_IO, true, _("Unable to stat file '%s'.\n"), filename);
+        close(fd);
         return NULL;
     }
