summaryrefslogtreecommitdiff
path: root/src/os_windows/os_rmdir.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/os_windows/os_rmdir.c')
-rw-r--r--src/os_windows/os_rmdir.c42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/os_windows/os_rmdir.c b/src/os_windows/os_rmdir.c
new file mode 100644
index 00000000..18090f09
--- /dev/null
+++ b/src/os_windows/os_rmdir.c
@@ -0,0 +1,42 @@
+/*-
+ * See the file LICENSE for redistribution information.
+ *
+ * Copyright (c) 1997, 2015 Oracle and/or its affiliates. All rights reserved.
+ *
+ * $Id$
+ */
+
+#include "db_config.h"
+
+#include "db_int.h"
+
+/*
+ * __os_rmdir --
+ * Remove a directory.
+ */
+int
+__os_rmdir(env, name)
+ ENV *env;
+ const char *name;
+{
+ DB_ENV *dbenv;
+ _TCHAR *tname;
+ int ret;
+
+ dbenv = env == NULL ? NULL : env->dbenv;
+
+ if (dbenv != NULL &&
+ FLD_ISSET(dbenv->verbose, DB_VERB_FILEOPS | DB_VERB_FILEOPS_ALL))
+ __db_msg(env, DB_STR_A("0240", "fileops: rmdir %s",
+ "%s"), name);
+
+ TO_TSTRING(env, name, tname, ret);
+ if (ret != 0)
+ return (ret);
+ RETRY_CHK(!RemoveDirectory(tname), ret);
+ FREE_STRING(env, tname);
+ if (ret != 0)
+ return (__os_posix_err(ret));
+
+ return (ret);
+}