1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Norton Commander's Graft function

Discussion in 'T&T - Aliases' started by Charles G, Sep 8, 2011.

  1. Charles G

    Joined:
    Apr 2, 2011
    Messages:
    493
    Likes Received:
    0
    I am starting to use TCMD v13 and one of the things I used to do with the old NC's file management aspect was to Graft:

    " graft a subdirectory, moving it to a different parent directory in a single operation"

    Didn't know if one had an alias already did this?

    Looking for "graft" in the current v13 help file - I see this on the REN topic:

    "You can also rename a subdirectory to a new location in the directory tree on the same physical drive (sometimes called "prune and graft"). You must specify the new name explicitly, not just give the path. For example, if the D:\TCMD directory contains a subdirectory TEST, you can rename TEST to be a subdirectory of the root directory like this:
    [d:\tcmd] ren TEST \TEST\

    "

    So it order to do an alias that mimics NC's Graft - is there a way to check if old_name and new_name are on the same physical drive / or partition? Would @truename on both work?

    Thanks in advance....
     
    #1
  2. Steve Fabian

    Joined:
    May 20, 2008
    Messages:
    3,531
    Likes Received:
    4
    From: Charles G
    | So it order to do an alias that mimics NC's Graft - is there a way to
    | check if old_name and new_name are on the same physical drive / or
    | partition? Would @truename on both work?

    Yes. But do not expect REN to "prune and graft" if the drive letters do not match using @FULL, e.g., if you use the SUBST command or NET USE or any other method to assign a second drive letter to the same volume. The MS API function used by REN does not go the whole way to use the equivalent of @TRUENAME to check whether or not the two paths are physically on the same file system (volume), only the drive letter.

    OTOH the MOVE command can perform "prune and graft" even across networks. It does it by useing REN if possible, COPY and DEL otherwise.
    --
    HTH, Steve
     
    #2
  3. David Marcus

    Joined:
    Jun 4, 2008
    Messages:
    577
    Likes Received:
    0
    #3

Share This Page