Index: /trunk/psLib/src/sys/psSlurp.c
===================================================================
--- /trunk/psLib/src/sys/psSlurp.c	(revision 12071)
+++ /trunk/psLib/src/sys/psSlurp.c	(revision 12072)
@@ -5,6 +5,6 @@
  *  @author Joshua Hoblitt, University of Hawaii
  *
- *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-02-03 05:54:08 $
+ *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-02-27 03:31:56 $
  *
  *  Copyright 2006 University of Hawaii
@@ -17,6 +17,10 @@
 #include <stdio.h>
 #include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
 
 #include "psType.h"
+#include "psAssert.h"
 #include "psError.h"
 #include "psSlurp.h"
@@ -56,6 +60,29 @@
 }
 
+
 psString psSlurpFile(FILE *stream)
 {
     return psSlurpFD(fileno(stream));
 }
+
+
+psString psSlurpFilename(const char *filename)
+{
+    PS_ASSERT_PTR_NON_NULL(filename, NULL);
+
+    int fd = open(filename, O_RDONLY);
+    if (fd < 0) {
+        psError(PS_ERR_IO, true, "Failed to open specified file, %s\n", filename);
+        return NULL;
+    }
+
+    psString text = psSlurpFD(fd);
+
+    if (close(fd) != 0) {
+        psError(PS_ERR_IO, true, "Failed to close specified file, %s\n", filename);
+        psFree(text);
+        return NULL;
+    }
+
+    return text;
+}
Index: /trunk/psLib/src/sys/psSlurp.h
===================================================================
--- /trunk/psLib/src/sys/psSlurp.h	(revision 12071)
+++ /trunk/psLib/src/sys/psSlurp.h	(revision 12072)
@@ -4,6 +4,6 @@
  * @author Joshua Hoblitt, University of Hawaii
  *
- * @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- * @date $Date: 2007-02-08 01:59:47 $
+ * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ * @date $Date: 2007-02-27 03:31:56 $
  */
 
@@ -24,4 +24,9 @@
                     );
 
+// Read ("slurp") a file (specified by filename)
+// and return a string containing the entire file.
+psString psSlurpFilename(const char *filename // Filename 
+                    );
+
 /// @}
 #endif
