diff options
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r-- | src/backend/commands/dbcommands.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 516c900c41a..32c4c459c9a 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -9,7 +9,7 @@ * * * 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 $ * *------------------------------------------------------------------------- */ @@ -302,7 +302,11 @@ createdb(const CreatedbStmt *stmt) } /* 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) { @@ -751,7 +755,11 @@ remove_dbdirs(const char *nominal_loc, const char *alt_loc) } } +#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) { |