[sword-cvs] sword/src/mgr filemgr.cpp,1.30,1.31 installmgr.cpp,1.14,1.15

sword@www.crosswire.org sword@www.crosswire.org
Fri, 15 Aug 2003 01:52:17 -0700


Update of /usr/local/cvsroot/sword/src/mgr
In directory www:/tmp/cvs-serv15374/src/mgr

Modified Files:
	filemgr.cpp installmgr.cpp 
Log Message:
no message

Index: filemgr.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/mgr/filemgr.cpp,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -d -r1.30 -r1.31
--- filemgr.cpp	7 Aug 2003 23:23:32 -0000	1.30
+++ filemgr.cpp	15 Aug 2003 08:52:15 -0000	1.31
@@ -183,7 +183,7 @@
 		
 		::close(fd);
 		::close(file->fd);
-		unlink(buf);		// remove our tmp file
+		removeFile(buf);		// remove our tmp file
 		file->fd = -77;	// causes file to be swapped out forcing open on next call to getFd()
 	}
 	else { // put offset back and return failure
@@ -288,7 +288,7 @@
 	strcpy(buf, pName);
 	int end = strlen(buf) - 1;
 	while (end) {
-		if (buf[end] == '/')
+		if ((buf[end] == '/') || (buf[end] == '\\'))
 			break;
 		end--;
 	}
@@ -296,16 +296,16 @@
 	if (strlen(buf)>0) {
 		if (access(buf, 02)) {  // not exists with write access?
 			if ((retCode = mkdir(buf
-                                        #ifndef WIN32
-                                        , 0755
-                                        #endif
-                                        ))) {
+#ifndef WIN32
+					, 0755
+#endif
+					))) {
 				createParent(buf);
 				retCode = mkdir(buf
-                                        #ifndef WIN32
-                                        , 0755
-                                        #endif
-                                        );
+#ifndef WIN32
+					, 0755
+#endif
+					);
 			}
 		}
 	}
@@ -345,6 +345,11 @@
 	::close(sfd);
 	
 	return 0;
+}
+
+
+int FileMgr::removeFile(const char *fName) {
+	::remove(fName);
 }
 
 

Index: installmgr.cpp
===================================================================
RCS file: /usr/local/cvsroot/sword/src/mgr/installmgr.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- installmgr.cpp	7 Aug 2003 22:51:21 -0000	1.14
+++ installmgr.cpp	15 Aug 2003 08:52:15 -0000	1.15
@@ -86,7 +86,10 @@
 InstallMgr::InstallMgr(const char *privatePath) {
 	this->privatePath = 0;
 	stdstr(&(this->privatePath), privatePath);
-	installConf = new SWConfig(((SWBuf)privatePath + "/InstallMgr.conf").c_str());
+	SWBuf confPath = (SWBuf)privatePath + "/InstallMgr.conf";
+	FileMgr::createParent(confPath.c_str());
+	
+	installConf = new SWConfig(confPath.c_str());
 
 	SectionMap::iterator sourcesSection;
 	ConfigEntMap::iterator sourceBegin;