Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
60e79adb
Commit
60e79adb
authored
Mar 29, 2007
by
Jason Edmeades
Committed by
Alexandre Julliard
Mar 30, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
xcopy: Add support for /P (Prompt).
parent
d742bb63
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
1 deletion
+25
-1
xcopy.c
programs/xcopy/xcopy.c
+25
-1
No files found.
programs/xcopy/xcopy.c
View file @
60e79adb
...
...
@@ -54,6 +54,7 @@
#define OPT_REPLACEREAD 0x00000800
#define OPT_COPYHIDSYS 0x00001000
#define OPT_IGNOREERRORS 0x00002000
#define OPT_SRCPROMPT 0x00004000
#define MAXSTRING 8192
...
...
@@ -145,7 +146,10 @@ int main (int argc, char *argv[])
return
RC_INITERROR
;
}
}
else
{
/* Process all the switch options */
/* Process all the switch options
Note: Windows docs say /P prompts when dest is created
but tests show it is done for each src file
regardless of the destination */
switch
(
toupper
(
argvW
[
0
][
1
]))
{
case
'I'
:
flags
|=
OPT_ASSUMEDIR
;
break
;
case
'S'
:
flags
|=
OPT_RECURSIVE
;
break
;
...
...
@@ -161,6 +165,7 @@ int main (int argc, char *argv[])
case
'R'
:
flags
|=
OPT_REPLACEREAD
;
break
;
case
'H'
:
flags
|=
OPT_COPYHIDSYS
;
break
;
case
'C'
:
flags
|=
OPT_IGNOREERRORS
;
break
;
case
'P'
:
flags
|=
OPT_SRCPROMPT
;
break
;
case
'-'
:
if
(
toupper
(
argvW
[
0
][
2
])
==
'Y'
)
flags
&=
~
OPT_NOPROMPT
;
break
;
default:
...
...
@@ -457,6 +462,25 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
}
}
/* Prompt each file if necessary */
if
(
!
skipFile
&&
(
flags
&
OPT_SRCPROMPT
))
{
DWORD
count
;
char
answer
[
10
];
BOOL
answered
=
FALSE
;
while
(
!
answered
)
{
printf
(
"%S? (Yes|No)
\n
"
,
copyFrom
);
ReadFile
(
GetStdHandle
(
STD_INPUT_HANDLE
),
answer
,
sizeof
(
answer
),
&
count
,
NULL
);
answered
=
TRUE
;
if
(
toupper
(
answer
[
0
])
==
'N'
)
skipFile
=
TRUE
;
else
if
(
toupper
(
answer
[
0
])
!=
'Y'
)
answered
=
FALSE
;
}
}
/* See if file exists */
destAttribs
=
GetFileAttributesW
(
copyTo
);
if
(
!
skipFile
&&
...
...
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