diff -ruw bincimap-1.0.24-dist/src/bincimapd-copy.cc bincimap-1.0.24/src/bincimapd-copy.cc
--- bincimap-1.0.24-dist/src/bincimapd-copy.cc	2003-02-22 01:05:17.000000000 -0800
+++ bincimap-1.0.24/src/bincimapd-copy.cc	2003-02-28 23:01:15.000000000 -0800
@@ -124,7 +124,7 @@
       }
      
       // this code copies a file with read and write
-      FILE *fpread = depot->open(mr->getID());
+      FILE *fpread = depot->fopen(mr->getID());
       if (fpread == NULL) {
 	logger << "COPY couldn't open " << mr->getID() << endl;
 	continue;
diff -ruw bincimap-1.0.24-dist/src/bincimapd-fetch.cc bincimap-1.0.24/src/bincimapd-fetch.cc
--- bincimap-1.0.24-dist/src/bincimapd-fetch.cc	2003-02-21 11:51:58.000000000 -0800
+++ bincimap-1.0.24/src/bincimapd-fetch.cc	2003-02-28 22:50:50.000000000 -0800
@@ -508,7 +508,7 @@
 		  prevmessage = message;
 		}
 		
-		if ((fp = depot->open(message->getID())) == NULL)
+		if ((fp = depot->fopen(message->getID())) == NULL)
 		  throw MessageException("error opening file");
 		
 		message->parseFull(fp);
@@ -533,7 +533,7 @@
 		prevmessage = message;
 	      }
 
-	      if ((fp = depot->open(message->getID())) == NULL)
+	      if ((fp = depot->fopen(message->getID())) == NULL)
 		throw MessageException("error opening file");
 	      
 	      message->parseOnlyHeader(fp);
@@ -556,7 +556,7 @@
 		prevmessage = message;
 	      }
 
-	      if ((fp = depot->open(message->getID())) == NULL)
+	      if ((fp = depot->fopen(message->getID())) == NULL)
 		throw MessageException("error opening file");
 	      
 	      message->parseFull(fp);
@@ -590,7 +590,7 @@
 		prevmessage = message;
 	      }
 	      
-	      if ((fp = depot->open(message->getID())) == NULL)
+	      if ((fp = depot->fopen(message->getID())) == NULL)
 		throw MessageException("error opening file");
 	      
 	      message->parseFull(fp);
@@ -629,7 +629,7 @@
 		vector<string> v;
 		string dummy;
 
-		if ((fp = depot->open(message->getID())) == NULL)
+		if ((fp = depot->fopen(message->getID())) == NULL)
 		  throw MessageException("error opening file");
 
 		size = fullheader 
@@ -659,7 +659,7 @@
 		fp = NULL;
 	      } else {
 
-		if ((fp = depot->open(message->getID())) == NULL)
+		if ((fp = depot->fopen(message->getID())) == NULL)
 		  throw MessageException("error opening file");
 
 		int size;
@@ -700,7 +700,7 @@
 		prevmessage = message;
 	      }
 		
-	      if ((fp = depot->open(message->getID())) == NULL)
+	      if ((fp = depot->fopen(message->getID())) == NULL)
 		throw MessageException("error opening file");
 	      
 	      message->parseFull(fp);
@@ -714,7 +714,7 @@
 	    vector<string> v;
 	    string dummy;
 
-	    if ((fp = depot->open(message->getID())) == NULL)
+	    if ((fp = depot->fopen(message->getID())) == NULL)
 	      throw MessageException("error opening file");
 
 	    int size = mptr->printDoc(fp, com, fatt.offsetstart, 
@@ -741,7 +741,7 @@
 		prevmessage = message;
 	      }
 
-	      if ((fp = depot->open(message->getID())) == NULL)
+	      if ((fp = depot->fopen(message->getID())) == NULL)
 		throw MessageException("error opening file");
 	      
 	      message->parseFull(fp);
@@ -755,7 +755,7 @@
 	    vector<string> v;
 	    string dummy;
 
-	    if ((fp = depot->open(message->getID())) == NULL)
+	    if ((fp = depot->fopen(message->getID())) == NULL)
 	      throw MessageException("error opening file");
 
 	    int size = mptr->printHeader(fp, com, v, true, fatt.offsetstart, 
@@ -781,7 +781,7 @@
 		prevmessage = message;
 	      }
 		
-	      if ((fp = depot->open(message->getID())) == NULL)
+	      if ((fp = depot->fopen(message->getID())) == NULL)
 		throw MessageException("error opening file");
 	      
 	      message->parseFull(fp);
@@ -797,7 +797,7 @@
 	      bodyfetch = true;;
 
 	    const MimePart *mptr = message;
-	    if ((fp = depot->open(message->getID())) == NULL)
+	    if ((fp = depot->fopen(message->getID())) == NULL)
 	      throw MessageException("error opening file");
 
 	    int size;
diff -ruw bincimap-1.0.24-dist/src/bincimapd-search.cc bincimap-1.0.24/src/bincimapd-search.cc
--- bincimap-1.0.24-dist/src/bincimapd-search.cc	2003-02-22 00:31:43.000000000 -0800
+++ bincimap-1.0.24/src/bincimapd-search.cc	2003-02-28 22:51:56.000000000 -0800
@@ -247,7 +247,7 @@
     case S_BCC: {
       if (!m->isHeaderParsed()) {
 	FILE *fp;
-	if ((fp = depot->open(m->getID())) == NULL) {
+	if ((fp = depot->fopen(m->getID())) == NULL) {
 	  // *** ERROR OPENING FILE ***
 	}
 	m->parseOnlyHeader(fp);
@@ -287,7 +287,7 @@
     case S_BODY: {
       if (!m->isAllParsed()) {
 	FILE *fp;
-	if ((fp = depot->open(m->getID())) == NULL) {
+	if ((fp = depot->fopen(m->getID())) == NULL) {
 	  // *** ERROR OPENING FILE ***
 	}
 	m->parseFull(fp);
@@ -302,7 +302,7 @@
 
       // search the body part of the message..
       FILE *fp;
-      if ((fp = depot->open(m->getID())) != NULL) {
+      if ((fp = depot->fopen(m->getID())) != NULL) {
 
 	fseek(fp, 0, SEEK_SET);
 
@@ -335,7 +335,7 @@
     case S_CC: {
       if (!m->isHeaderParsed()) {
 	FILE *fp;
-	if ((fp = depot->open(m->getID())) == NULL) {
+	if ((fp = depot->fopen(m->getID())) == NULL) {
 	  // *** ERROR OPENING FILE ***
 	}
 	m->parseOnlyHeader(fp);
@@ -361,7 +361,7 @@
     case S_FROM: {
       if (!m->isHeaderParsed()) {
 	FILE *fp;
-	if ((fp = depot->open(m->getID())) == NULL) {
+	if ((fp = depot->fopen(m->getID())) == NULL) {
 	  // FIXME: *** ERROR OPENING FILE ***
 	}
 	m->parseOnlyHeader(fp);
@@ -438,7 +438,7 @@
     case S_SUBJECT: {
       if (!m->isHeaderParsed()) {
 	FILE *fp;
-	if ((fp = depot->open(m->getID())) == NULL) {
+	if ((fp = depot->fopen(m->getID())) == NULL) {
 	  // FIXME: *** ERROR OPENING FILE ***
 	}
 	m->parseOnlyHeader(fp);
@@ -458,7 +458,7 @@
     case S_TEXT: {
       // search the body part of the message..
       FILE *fp;
-      if ((fp = depot->open(m->getID())) != NULL) {
+      if ((fp = depot->fopen(m->getID())) != NULL) {
 	// FIXME: *** ERROR OPENING FILE ***
 	int c;
 	char ring[astring.length()];
@@ -482,7 +482,7 @@
     case S_TO: {
       if (!m->isHeaderParsed()) {
 	FILE *fp;
-	if ((fp = depot->open(m->getID())) == NULL) {
+	if ((fp = depot->fopen(m->getID())) == NULL) {
 	  // FIXME: *** ERROR OPENING FILE ***
 	}
 	m->parseOnlyHeader(fp);
@@ -521,7 +521,7 @@
     case S_HEADER: {
       if (!m->isHeaderParsed()) {
 	FILE *fp;
-	if ((fp = depot->open(m->getID())) == NULL) {
+	if ((fp = depot->fopen(m->getID())) == NULL) {
 	  // FIXME: *** ERROR OPENING FILE ***
 	}
 	m->parseOnlyHeader(fp);
@@ -544,7 +544,7 @@
       if (m->getSize() == -1) {
 	if (!m->isAllParsed()) {
 	  FILE *fp;
-	  if ((fp = depot->open(m->getID())) == NULL) {
+	  if ((fp = depot->fopen(m->getID())) == NULL) {
 	    // *** ERROR OPENING FILE ***
 	  }
 	  m->parseFull(fp);
@@ -572,7 +572,7 @@
     case S_SENTBEFORE: {
       if (!m->isHeaderParsed()) {
 	FILE *fp;
-	if ((fp = depot->open(m->getID())) == NULL) {
+	if ((fp = depot->fopen(m->getID())) == NULL) {
 	  // FIXME: *** ERROR OPENING FILE ***
 	}
 	m->parseOnlyHeader(fp);
@@ -605,7 +605,7 @@
     case S_SENTON: {
       if (!m->isHeaderParsed()) {
 	FILE *fp;
-	if ((fp = depot->open(m->getID())) == NULL) {
+	if ((fp = depot->fopen(m->getID())) == NULL) {
 	  // FIXME: *** ERROR OPENING FILE ***
 	}
 	m->parseOnlyHeader(fp);
@@ -638,7 +638,7 @@
     case S_SENTSINCE: {
       if (!m->isHeaderParsed()) {
 	FILE *fp;
-	if ((fp = depot->open(m->getID())) == NULL) {
+	if ((fp = depot->fopen(m->getID())) == NULL) {
 	  // FIXME: *** ERROR OPENING FILE ***
 	}
 	m->parseOnlyHeader(fp);
@@ -672,7 +672,7 @@
       if (m->getSize() == -1) {
 	if (!m->isAllParsed()) {
 	  FILE *fp;
-	  if ((fp = depot->open(m->getID())) == NULL) {
+	  if ((fp = depot->fopen(m->getID())) == NULL) {
 	    // *** ERROR OPENING FILE ***
 	  }
 	  m->parseFull(fp);
Only in bincimap-1.0.24/src/messagedepot/maildir: .maildir-open.cc.swp
diff -ruw bincimap-1.0.24-dist/src/messagedepot/maildir/maildir-open.cc bincimap-1.0.24/src/messagedepot/maildir/maildir-open.cc
--- bincimap-1.0.24-dist/src/messagedepot/maildir/maildir-open.cc	2003-02-18 14:24:35.000000000 -0800
+++ bincimap-1.0.24/src/messagedepot/maildir/maildir-open.cc	2003-03-01 00:02:16.000000000 -0800
@@ -35,19 +35,52 @@
 #include <config.h>
 #endif
 
+#include <stdio.h>
+/* Required for POSIX.1 open() and O_RDONLY flags */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
 #include "maildir.h"
 
 using namespace ::std;
 
 //------------------------------------------------------------------------
-FILE *Binc::mdepot::Maildir::open(const string &fixed)
+
+/**
+ * open returns a posix file descriptor for the given file name
+ * Added 20030228 --cld
+ */
+int Binc::mdepot::Maildir::open(const string &fixed)
+{
+  int fp;
+  string actualfilename = fixedtofile[fixed];
+  if (actualfilename == "")
+    return -1;
+
+  while ((fp = ::open((path + "/cur/" + actualfilename).c_str(), O_RDONLY)) == -1) {
+    scanFileNames();
+    if (fixedtofile.find(fixed) == fixedtofile.end())
+      return -1;
+    actualfilename = fixedtofile[fixed];
+  }
+
+  return fp;
+}
+
+//------------------------------------------------------------------------
+/**
+ * fopen returns a C stream FILE* for the given file name
+ */
+FILE *Binc::mdepot::Maildir::fopen(const string &fixed)
 {
   FILE *fp;
   string actualfilename = fixedtofile[fixed];
   if (actualfilename == "")
     return NULL;
 
-  while ((fp = fopen((path + "/cur/" + actualfilename).c_str(), "r")) == NULL) {
+  while ((fp = ::fopen((path + "/cur/" + actualfilename).c_str(), "r"))
+      == NULL) {
     scanFileNames();
     if (fixedtofile.find(fixed) == fixedtofile.end())
       return NULL;
diff -ruw bincimap-1.0.24-dist/src/messagedepot/maildir/maildir.h bincimap-1.0.24/src/messagedepot/maildir/maildir.h
--- bincimap-1.0.24-dist/src/messagedepot/maildir/maildir.h	2003-02-16 07:18:12.000000000 -0800
+++ bincimap-1.0.24/src/messagedepot/maildir/maildir.h	2003-02-28 23:01:37.000000000 -0800
@@ -95,8 +95,9 @@
 
     const std::string &getPath(void) const;
 
-    //-- access methods, open
-    FILE *open(const std::string &id);
+    //-- access methods, open and fopen
+    int open(const std::string &id);
+    FILE *fopen(const std::string &id);
 
     //-- access methods, set
 
diff -ruw bincimap-1.0.24-dist/src/messagedepot/messagedepot.h bincimap-1.0.24/src/messagedepot/messagedepot.h
--- bincimap-1.0.24-dist/src/messagedepot/messagedepot.h	2003-02-08 05:49:14.000000000 -0800
+++ bincimap-1.0.24/src/messagedepot/messagedepot.h	2003-02-28 23:03:32.000000000 -0800
@@ -88,7 +88,12 @@
       return t; 
     }
 
-    virtual FILE *open(const std::string &s)
+    virtual int open(const std::string &s)
+    {
+      return -1;
+    }
+
+    virtual FILE *fopen(const std::string &s)
     {
       return NULL;
     }
Only in bincimap-1.0.24/src: tags
