*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.110 2003/01/27 00:46:41 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.111 2003/04/04 20:40:44 momjian Exp $
*
*-------------------------------------------------------------------------
*/
}
/* Copy the template database to the new location */
+#ifndef WIN32
snprintf(buf, sizeof(buf), "cp -r '%s' '%s'", src_loc, target_dir);
+#else
+ snprintf(buf, sizeof(buf), "xcopy /e /i /q '%s' '%s'", src_loc, target_dir);
+#endif
if (system(buf) != 0)
{
}
}
+#ifndef WIN32
snprintf(buf, sizeof(buf), "rm -rf '%s'", target_dir);
+#else
+ snprintf(buf, sizeof(buf), "rmdir /s /q \"%s\"", target_dir);
+#endif
if (system(buf) != 0)
{
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.94 2003/03/20 06:43:35 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.95 2003/04/04 20:40:45 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
static bool do_connect(const char *new_dbname, const char *new_user);
static bool do_shell(const char *command);
-
-
/*----------
* HandleSlashCmds:
*
sys = malloc(strlen(editorName) + strlen(fname) + 10 + 1);
if (!sys)
return false;
- sprintf(sys, "exec %s '%s'", editorName, fname);
+ sprintf(sys,
+#ifndef WIN32
+ "exec "
+#endif
+ "%s '%s'", editorName, fname);
result = system(sys);
if (result == -1)
psql_error("could not start editor %s\n", editorName);
else
exit(EXIT_FAILURE);
}
- sprintf(sys, "exec %s", shellName);
+ sprintf(sys,
+#ifndef WIN32
+ "exec "
+#endif
+ "%s", shellName);
result = system(sys);
free(sys);
}