[PATCH 01/18] XCOPY: Add support for /W (pause)

Jason Edmeades us at edmeades.me.uk
Thu Mar 29 16:20:59 CDT 2007


---
 programs/xcopy/xcopy.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/programs/xcopy/xcopy.c b/programs/xcopy/xcopy.c
index 718923e..848fe0d 100644
--- a/programs/xcopy/xcopy.c
+++ b/programs/xcopy/xcopy.c
@@ -46,6 +46,7 @@
 #define OPT_QUIET        0x00000008
 #define OPT_FULL         0x00000010
 #define OPT_SIMULATE     0x00000020
+#define OPT_PAUSE        0x00000040
 
 WINE_DEFAULT_DEBUG_CHANNEL(xcopy);
 
@@ -130,6 +131,7 @@ int main (int argc, char *argv[])
             case 'Q': flags |= OPT_QUIET;         break;
             case 'F': flags |= OPT_FULL;          break;
             case 'L': flags |= OPT_SIMULATE;      break;
+            case 'W': flags |= OPT_PAUSE;         break;
             default:
               WINE_FIXME("Unhandled parameter '%s'\n", wine_dbgstr_w(*argvW));
             }
@@ -160,6 +162,16 @@ int main (int argc, char *argv[])
     WINE_TRACE("Dest   Stem : '%s'\n", wine_dbgstr_w(destinationstem));
     WINE_TRACE("Dest   Spec : '%s'\n", wine_dbgstr_w(destinationspec));
 
+    /* Pause if necessary */
+    if (flags & OPT_PAUSE) {
+        DWORD count;
+        char pausestr[10];
+
+        printf("Press <enter> to begin copying\n");
+        ReadFile (GetStdHandle(STD_INPUT_HANDLE), pausestr, sizeof(pausestr),
+                  &count, NULL);
+    }
+
     /* Now do the hard work... */
     rc = XCOPY_DoCopy(sourcestem, sourcespec,
                 destinationstem, destinationspec,
-- 
1.5.0




More information about the wine-patches mailing list