From 09aad5a3a67338e7b2dc83e6b9799c580e6511ab Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Thu, 15 May 2003 17:59:17 +0000 Subject: Add copydir() function because xcopy doesn't work in XP without a window. --- src/backend/commands/dbcommands.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/backend/commands/dbcommands.c') diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 1c3b554c291..bd436878189 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.114 2003/05/07 03:47:08 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.115 2003/05/15 17:59:17 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -311,11 +311,10 @@ 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); + if (system(buf) != 0) #else - snprintf(buf, sizeof(buf), "xcopy /e /i /q '%s' '%s'", src_loc, target_dir); + if (copydir(src_loc, target_dir) != 0) #endif - - if (system(buf) != 0) { if (remove_dbdirs(nominal_loc, alt_loc)) elog(ERROR, "CREATE DATABASE: could not initialize database directory"); -- cgit v1.2.3