D3 and mvBase

 View Only

 RENAME-FILE

Alex Polglaze's profile image
PARTNER Alex Polglaze posted 02-25-2024 21:27

There is a command in D3, RENAME-FILE, which changes the name, but does not appear to change the name in Processes where that particular file, or data from it is used. Is there a straightforward way to change all references to the file where it is accessed throughout the system?

Thanks

Richard Ginsburg's profile image
PARTNER Richard Ginsburg

Rather than renaming the original file, just make a Q-Pointer to it. If the original file was called CUSTOMER and you want to call it client, the Q-Pointer would be:

ED MD CLIENT

001 Q

002 (the account name)

003 CUSTOMER

Alex Polglaze's profile image
PARTNER Alex Polglaze

Thanks Richard, but I have been standardising my file naming convention and I actually need to rename these files as we are using Split Accounts, a fantastic feature in SB+ BTW, that allows us to have all our software in one account and all the data in separate, split accounts for our our clients. One upgrade or update and all accounts updated, so we already use Q-Pointers extensively and we don't need another layer. The RENAME-FILE works, but doesn't get down to the level where we have co-relatives in file definitions, etc..

Manu Fernandes's profile image
PARTNER Manu Fernandes

Hi ALex,

It looks like you run SB+.

Inside SB+, there is a tool SEARCH you type /SEARCH 

it request the type of search -> FILE

it scan all defn an prepare a reporting to list where the file is used. 

it does not perform the replace but it's a little help.

Ihope this help.

manu

Merry Player's profile image
Merry Player

Hi Alex,

   The version/type/etc of mv you have doesn’t matter. It’s so easy to write your own SYSTEM-SEARCH and SYSTEM-LIST and SYSTEM-CHANGE-FILE-NAME commands from Sys…

Please remember to share when you have this working, with documentation so that other system types can alter the code as required

Plus, why change the name? It’s internal, no user will see it. If they do, then make a Q-Pointer as mentioned earlier in the thread.

Happy coding, one if the great things about being alive 🙂

Merry

Alberto Leal's profile image
Alberto Leal

There is also the move-file

https://www3.rocketsoftware.com/rocketd3/support/documentation/d3nt/102/refman/TCL/move_file_command.htm#reference2408

unlike rename-file, move-file changes the master dict also

Alex Polglaze's profile image
PARTNER Alex Polglaze

Thanks Manu, I have been using SEARCH extensively and what I have found is that after using the RENAME-FILE command, that some instances of the file have been changed to the new name in Processes and Basic Programmes, but not in every case. Therefore in some instances the RENAME-FILE command has changed the file name within one Process, but not in the next. It is very time consuming to have to check for every instance.

David Knight's profile image
PARTNER David Knight

Hi Alex,

I am not aware of anything which will do what you ask; as the permutations are endless and highly system-specific.

On a d3 system, the source for these commands is available; which when I do a QUICK scan over all seems to use the same core routine which is ultimately move-file. Source code trial finishes at the internal command :move-file.

So: does the routine do anything other that what it states on the tin? No.

References to the filename could be anywhere on an entire system; as you have found. Possibly areas are INCLUDES, DICTIONARIES, source code, Q-pointers and on it goes.

Tools that MAY help include the SB+ one mentioned as well as d3's SEARCH-SYSTEM and FIND; but nothing I can think of would be a global one-size-fixes-all routine.

Sorry to be the bearer of bad news