diff options
author | Bruce Momjian <bruce@momjian.us> | 2003-04-04 20:40:45 +0000 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2003-04-04 20:40:45 +0000 |
commit | 9bad936f67cb7561d0d232ca365e23fe73219a1a (patch) | |
tree | aec87a77592b0e0da3c1ba50844b0a9a9cea7b72 /src/backend/commands/dbcommands.c | |
parent | 9c264975d5e1c4c832946e2eb35d4c77a27aea4d (diff) | |
download | postgresql-9bad936f67cb7561d0d232ca365e23fe73219a1a.tar.gz postgresql-9bad936f67cb7561d0d232ca365e23fe73219a1a.zip |
Handle cp, rm, and exec for Win32.
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) { |