#3 Windows support for overwriting the previous result database

open
nobody
None
5
2012-09-14
2006-08-24
No

Removing a directory under Windows can be done by
invoking the 'rmdir' command through a 'system' call.
Here is a patch:

Index: src/glean/environ.cpp

RCS file: /cvsroot/glean/glean/src/glean/environ.cpp,v
retrieving revision 1.3
diff -u -r1.3 environ.cpp
--- src/glean/environ.cpp 29 Oct 2005 14:43:51 -0000 1.3
+++ src/glean/environ.cpp 24 Aug 2006 07:00:38 -0000
@@ -42,7 +42,7 @@
#elif defined(MS)

#include <sys stat.h="">

+#include <stdio.h>
#endif

namespace GLEAN {
@@ -89,7 +89,10 @@
if (opt.mode == Options::run) {
if (opt.overwrite) {
// XXX a Windows programmer needs to complete this
- abort();
+ //abort();
+ char cmd[1000];
+ _snprintf(cmd, 999, "rmdir /s /q %s",
opt.db1Name.c_str());
+ system(cmd);
}
if (!CreateDirectory(opt.db1Name.c_str(),0)) {
if (GetLastError() == ERROR_ALREADY_EXISTS)

Discussion


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks