Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
4794bec1
Commit
4794bec1
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 xcopy /A and /M (archive copies).
parent
60e79adb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
xcopy.c
programs/xcopy/xcopy.c
+23
-1
No files found.
programs/xcopy/xcopy.c
View file @
4794bec1
...
...
@@ -55,6 +55,8 @@
#define OPT_COPYHIDSYS 0x00001000
#define OPT_IGNOREERRORS 0x00002000
#define OPT_SRCPROMPT 0x00004000
#define OPT_ARCHIVEONLY 0x00008000
#define OPT_REMOVEARCH 0x00010000
#define MAXSTRING 8192
...
...
@@ -166,6 +168,9 @@ int main (int argc, char *argv[])
case
'H'
:
flags
|=
OPT_COPYHIDSYS
;
break
;
case
'C'
:
flags
|=
OPT_IGNOREERRORS
;
break
;
case
'P'
:
flags
|=
OPT_SRCPROMPT
;
break
;
case
'A'
:
flags
|=
OPT_ARCHIVEONLY
;
break
;
case
'M'
:
flags
|=
OPT_ARCHIVEONLY
|
OPT_REMOVEARCH
;
break
;
case
'-'
:
if
(
toupper
(
argvW
[
0
][
2
])
==
'Y'
)
flags
&=
~
OPT_NOPROMPT
;
break
;
default:
...
...
@@ -454,6 +459,8 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
/* See if allowed to copy it */
srcAttribs
=
GetFileAttributesW
(
copyFrom
);
WINE_TRACE
(
"Source attribs: %d
\n
"
,
srcAttribs
);
if
((
srcAttribs
&
FILE_ATTRIBUTE_HIDDEN
)
||
(
srcAttribs
&
FILE_ATTRIBUTE_SYSTEM
))
{
...
...
@@ -462,6 +469,11 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
}
}
if
(
!
(
srcAttribs
&
FILE_ATTRIBUTE_ARCHIVE
)
&&
(
flags
&
OPT_ARCHIVEONLY
))
{
skipFile
=
TRUE
;
}
/* Prompt each file if necessary */
if
(
!
skipFile
&&
(
flags
&
OPT_SRCPROMPT
))
{
DWORD
count
;
...
...
@@ -483,6 +495,8 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
/* See if file exists */
destAttribs
=
GetFileAttributesW
(
copyTo
);
WINE_TRACE
(
"Dest attribs: %d
\n
"
,
srcAttribs
);
if
(
!
skipFile
&&
destAttribs
!=
INVALID_FILE_ATTRIBUTES
&&
!
(
flags
&
OPT_NOPROMPT
))
{
DWORD
count
;
...
...
@@ -551,7 +565,15 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
return
RC_WRITEERROR
;
}
}
filesCopied
++
;
/* If /M supplied, remove the archive bit after successful copy */
if
(
!
skipFile
)
{
if
((
srcAttribs
&
FILE_ATTRIBUTE_ARCHIVE
)
&&
(
flags
&
OPT_REMOVEARCH
))
{
SetFileAttributes
(
copyFrom
,
(
srcAttribs
&
~
FILE_ATTRIBUTE_ARCHIVE
));
}
filesCopied
++
;
}
}
}
...
...
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