XXCOPY
[ Back to Table of Contents ] [ << ] [ >> ]

XXCOPY TECHNICAL BULLETIN #46



From:    Kan Yabumoto           tech@xxcopy.com
To:      XXCOPY user
Subject: The mystery in Directory Prompt (Y/N/A/R/S)
Date:    2008-08-21
====================================================================


Introduction:

    Most users who have used XXCopy for some time become familar
    with the following user prompt:

         (Y/N/A/R/S) ?

    The initial motivation of this article was to demystify the
    funny prompt.  But, the more important purpose is to advocate
    the use of the advanced directory traversing technique which
    can be handy in many occasions (See the Tips at the end).  


The Directory Prompt function:

    The (Y/N/A/R/S) prompt appears when XXCOPY traverses a
    directory tree.  It keeps coming back before a directory is
    being processed for whatever the operation is for.  The
    command switch that enables this user prompt is /PD and
    /PD0 disables it (/PD stands for "Prompt on Directory").
    
    More ofen than not, it shows up in a situation where XXCOPY
    deletes something in the operation with the /S (or /E) switch
    (to process subdirectories).  That's because XXCOPY implicitly
    enables the /PD switch on a destructive operation by default.

    
The User Options:

    Here is our official description of the five possible
    responses the user can choose:
    
        Y:  Yes to this directory
        N:  No  to this direcotory
        A:  Yes to All remaing cases
        R:  Yes to Remaining directories of parent's directory 
        S:  Yes to this directory and its Subdirectories.

    There is one more choice (works with any other prompt)
 
        ?:  Ask which switch suppresses the prompt. 
        

    Everyone knows that "Y" stands for Yes, "N" stands for No.
    The "A" response (Yes for ALL) is also easy to understand.
    
    The trouble is that our description for the "R" and "S"
    responses are not completely clear to many users.

    It is regrettable that we just can't describe the action
    satisfactorily even with more words (notice that the
    descritions for Y, N, and A are all very short).  We concede
    that even the R and S are both mnemonically awkward.
    
    So, we just give up using words for the darn thing.


Graphical presentation:

    This is a case where a combination of an example with a diagram
    works much better than many words.


    Say, you have the following directory structure:

       C:\parent\
          |
          +-- dir_1\
          |
          +-- dir_2\
          |   |
          |   +-- dir_21\
          |   |
          |   +-- dir_22\
          |   |   |
          |   |   +-- dir_221\
          |   |   |
          |   |   +-- dir_222\
          |   |       |
          |   |       +-- dir_2221\
          |   |       |
          |   |       +-- dir_2222\
          |   |      
          |   +-- dir_23\
          |
          +-- dir_3\

 
        You may assume that files are present in some (or all)
        of the directories (but that's not relevant here).
     


    Then, suppose you run the following XXCOPY command:
 
       xxcopy  c:\parent\  /rsy /s


    You will encounter the Directory Prompts in the following order: 

       Path display              User Prompt          Response
      -----------------------------------------------------------------
       C:\parent\                RmDir (Y/N/A/R/S)?   Y (to process it)
       C:\parent\dir_1\          RmDir (Y/N/A/R/S)?   N (to skip it)
       C:\parent\dir_2\          RmDir (Y/N/A/R/S)?   Y (to process it)
       C:\parent\dir_2\dir_21    RmDir (Y/N/A/R/S)?   N (to skip it)
       C:\parent\dir_2\dir_22    RmDir (Y/N/A/R/S)?

    Here, we assume your first four responces were Y, N, Y, and N.

    At this juncture, the current directory is C:\parent\dir_2\dir_22\.

The "Y" response (yes on the directory) will place you at the first subdirectory (dir_221\). The "N" response will skip the current directory and move you to the next (dir_23\). It will be the first immediate sibling of itself, or if no siblings left inside the parent's directory, then, the parent's immediate sibling. The "A" response will give a go-ahead to all directories which has an effect equivalent to disabling the prompting feature for the remainder of the current XXCOPY job. The R and S responses are between the ALL or NOTHING choices. With an "S" response, XXCOPY will process the current directory and its subdirectories (disabling the Directory Prompts inside the directory only). No matter how many subdirectories are in the current directory, or how deep the subdirectory level is, inside the current directory the /PD function is disabled. The "S" response is equivalent to responding with "Y" to all the subdirectories inside the current directory. Lastly, the scope of the "R" response is smaller than the "A" but possibly larger than the "S" response. With an "R" response, not only will the subdirectories of the current directory be processed without user prmopt, but also the remaining subdirectories (siblings of the current directory) will be procssed without the prompt. That is, the "R" response can be thought of as equivalent to successive "S" responses to all the siblings of the current directory. In short, "S" and "R" are to suppress the Directory Prompts on certain group of directories. Tips: Even for a non-destructive operation, you may add the /PD swith to help you navigate through subdirectories to select an arbitrary set of directories for some file management operations. Just in case that the above diagram has no lasting impression on you, you should remember that the A, R, and S in the (Y/N/A/R/S) are in the decreasing order of scope. If that doesn't work, then, just remember to come back to this page and view the diagram again. This feature is too good to be forgotten. Caution: Some earlier versions of XXCopy (before v.3.00.0), had bugs that prevented the proper action on R and S responses.

© Copyright 2008 Pixelab, Inc. All rights reserved.

[ XXCOPY Home ] [ Table of Contents ] [ << ] [ >> ]

Join the XXCOPY group