1
0
mirror of https://github.com/wine-mirror/wine synced 2024-07-08 20:06:18 +00:00

xcopy: Add support for /T (no copy).

This commit is contained in:
Jason Edmeades 2007-03-29 22:21:00 +01:00 committed by Alexandre Julliard
parent cf872445a3
commit 59bf2dc341

View File

@ -47,6 +47,7 @@
#define OPT_FULL 0x00000010 #define OPT_FULL 0x00000010
#define OPT_SIMULATE 0x00000020 #define OPT_SIMULATE 0x00000020
#define OPT_PAUSE 0x00000040 #define OPT_PAUSE 0x00000040
#define OPT_NOCOPY 0x00000080
WINE_DEFAULT_DEBUG_CHANNEL(xcopy); WINE_DEFAULT_DEBUG_CHANNEL(xcopy);
@ -132,6 +133,7 @@ int main (int argc, char *argv[])
case 'F': flags |= OPT_FULL; break; case 'F': flags |= OPT_FULL; break;
case 'L': flags |= OPT_SIMULATE; break; case 'L': flags |= OPT_SIMULATE; break;
case 'W': flags |= OPT_PAUSE; break; case 'W': flags |= OPT_PAUSE; break;
case 'T': flags |= OPT_NOCOPY | OPT_RECURSIVE; break;
default: default:
WINE_FIXME("Unhandled parameter '%s'\n", wine_dbgstr_w(*argvW)); WINE_FIXME("Unhandled parameter '%s'\n", wine_dbgstr_w(*argvW));
} }
@ -181,7 +183,7 @@ int main (int argc, char *argv[])
/* Finished - print trailer and exit */ /* Finished - print trailer and exit */
if (flags & OPT_SIMULATE) { if (flags & OPT_SIMULATE) {
printf("%d file(s) would be copied\n", filesCopied); printf("%d file(s) would be copied\n", filesCopied);
} else { } else if (!(flags & OPT_NOCOPY)) {
printf("%d file(s) copied\n", filesCopied); printf("%d file(s) copied\n", filesCopied);
} }
if (rc == RC_OK && filesCopied == 0) rc = RC_NOFILES; if (rc == RC_OK && filesCopied == 0) rc = RC_NOFILES;
@ -412,8 +414,8 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
} }
copiedFile = TRUE; copiedFile = TRUE;
if (flags & OPT_SIMULATE) { if (flags & OPT_SIMULATE || flags & OPT_NOCOPY) {
/* Skip copy as just simulating */ /* Skip copy */
} else if (CopyFile(copyFrom, copyTo, TRUE) == 0) { } else if (CopyFile(copyFrom, copyTo, TRUE) == 0) {
printf("Copying of '%S' to '%S' failed with r/c %d\n", printf("Copying of '%S' to '%S' failed with r/c %d\n",
copyFrom, copyTo, GetLastError()); copyFrom, copyTo, GetLastError());