Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
9bad936f
Commit
9bad936f
authored
Apr 04, 2003
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle cp, rm, and exec for Win32.
parent
9c264975
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
6 deletions
+20
-6
src/backend/commands/dbcommands.c
src/backend/commands/dbcommands.c
+9
-1
src/bin/psql/command.c
src/bin/psql/command.c
+11
-5
No files found.
src/backend/commands/dbcommands.c
View file @
9bad936f
...
...
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.11
0 2003/01/27 00:46:41 tgl
Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.11
1 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
)
{
...
...
src/bin/psql/command.c
View file @
9bad936f
...
...
@@ -3,7 +3,7 @@
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.9
4 2003/03/20 06:43:3
5 momjian Exp $
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.9
5 2003/04/04 20:40:4
5 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
...
...
@@ -66,8 +66,6 @@ static bool do_edit(const char *filename_arg, PQExpBuffer query_buf);
static
bool
do_connect
(
const
char
*
new_dbname
,
const
char
*
new_user
);
static
bool
do_shell
(
const
char
*
command
);
/*----------
* HandleSlashCmds:
*
...
...
@@ -1515,7 +1513,11 @@ editFile(const char *fname)
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
);
...
...
@@ -1944,7 +1946,11 @@ do_shell(const char *command)
else
exit
(
EXIT_FAILURE
);
}
sprintf
(
sys
,
"exec %s"
,
shellName
);
sprintf
(
sys
,
#ifndef WIN32
"exec "
#endif
"%s"
,
shellName
);
result
=
system
(
sys
);
free
(
sys
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment