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

Alexandre Julliard julliard at wine.codeweavers.com
Fri Mar 30 06:20:18 CDT 2007


Module: wine
Branch: master
Commit: 59bf2dc341430d1b07fcdbed8fc1f8db5f335773
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=59bf2dc341430d1b07fcdbed8fc1f8db5f335773

Author: Jason Edmeades <us at edmeades.me.uk>
Date:   Thu Mar 29 22:21:00 2007 +0100

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

---

 programs/xcopy/xcopy.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/programs/xcopy/xcopy.c b/programs/xcopy/xcopy.c
index 848fe0d..193fff0 100644
--- a/programs/xcopy/xcopy.c
+++ b/programs/xcopy/xcopy.c
@@ -47,6 +47,7 @@
 #define OPT_FULL         0x00000010
 #define OPT_SIMULATE     0x00000020
 #define OPT_PAUSE        0x00000040
+#define OPT_NOCOPY       0x00000080
 
 WINE_DEFAULT_DEBUG_CHANNEL(xcopy);
 
@@ -132,6 +133,7 @@ int main (int argc, char *argv[])
             case 'F': flags |= OPT_FULL;          break;
             case 'L': flags |= OPT_SIMULATE;      break;
             case 'W': flags |= OPT_PAUSE;         break;
+            case 'T': flags |= OPT_NOCOPY | OPT_RECURSIVE; break;
             default:
               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 */
     if (flags & OPT_SIMULATE) {
         printf("%d file(s) would be copied\n", filesCopied);
-    } else {
+    } else if (!(flags & OPT_NOCOPY)) {
         printf("%d file(s) copied\n", filesCopied);
     }
     if (rc == RC_OK && filesCopied == 0) rc = RC_NOFILES;
@@ -412,8 +414,8 @@ static int XCOPY_DoCopy(WCHAR *srcstem, WCHAR *srcspec,
             }
 
             copiedFile = TRUE;
-            if (flags & OPT_SIMULATE) {
-                /* Skip copy as just simulating */
+            if (flags & OPT_SIMULATE || flags & OPT_NOCOPY) {
+                /* Skip copy */
             } else if (CopyFile(copyFrom, copyTo, TRUE) == 0) {
                 printf("Copying of '%S' to '%S' failed with r/c %d\n",
                        copyFrom, copyTo, GetLastError());




More information about the wine-cvs mailing list