Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Norton Commander's Graft function

Apr
1,794
15
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....
 
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
 
Back
Top