Operating System - OpenVMS
1755305 Members
3864 Online
108831 Solutions
New Discussion юеВ

rename path issue [ newbie question]

 
SOLVED
Go to solution
nipun_2
Regular Advisor

Re: rename path issue [ newbie question]

I have a little confusion here what is the different between

$rename disk1:[acct1.data.dirTOMOVE...]*.*;* disk1:[ACCT2.data.dirTOMOV...]*.*;*

and

$rename disk1:[acct1.data.dirTOMOVE...]*.*;* disk1:[ACCT2.data.dirTOMOV]*.*;*


Note: I need to move the directory and all it's subdirectories and their contents. The data is very critical so need to understand clearly what I am doing.

Thanks again

Antoniov.
Honored Contributor

Re: rename path issue [ newbie question]


Does this mean I need to have DIRTOMOVE.DIR already created in ACCT2 before hand?

No or Yes?
Because Hein and me have different point of view I try to explain better.
[No]
If ACCT2 doesn't exist, ACCT1 is renamed as is keeping source owner (of ACCT1).
[Yes]
If ACCT2 exists (and/or its subdirectory) command can't rename directory (because it alredy exists), send you an error message and keeps taregt owner (of ACCT2).

Antonio Vigliotti
Antonio Maria Vigliotti
nipun_2
Regular Advisor

Re: rename path issue [ newbie question]

I would like to append one other point

if I do the following

$rename disk1:[acct1.data]dirTOMOVE.dir - disk1:[ACCT2.data]

won't this entirely solve my problem?
Basically, it will copy all the contents and sub directories of dirTOMOVE.dir to disk1:[ACCT2.data]

I already have disk1:[ACCT2.data ] setup.

Jan van den Ende
Honored Contributor

Re: rename path issue [ newbie question]

Nipun,


when I do
$ RENAME/LOG -
DISK1:[ACCT1.DATA]DIRTOMOVE.DIR -
DISK1:[ACCT2.DATA]DIRTOMOVE.DIR

Does this mean I need to have DIRTOMOVE.DIR already created in ACCT2 before hand?

To this, Hein answered "Yes"

I am sorry, but have to ABSOLUTELY disagree!!

The (special) file DIRTOMOVE.DIR always has version ;1.
It has to, if it is be able to functon as a DIRECTORY.
Now, if it already exists in [acct2.data], the RENAME will already find a ;1 , and generate ;2
Now there are TWO versions of the .DIR file, and you are in for some nasty surprises!
Those may be summarised by: YOU DO NOT WANT THIS!!!

So, the answer to the quoted question HAS to be NO, it does NOT have to exist, at should NOT exist!!

And Antonio's "RENAME will give an error" also is INCORRECT! It just creates ;2

Proost.

Have one on me.

jpe


Don't rust yours pelled jacker to fine doll missed aches.
Antoniov.
Honored Contributor

Re: rename path issue [ newbie question]

Nipun,
sorry, sorry sorry.
I wrong :-(
Don't read my previous posts.


$rename disk1:[acct1.data]dirTOMOVE.dir - disk1:[ACCT2.data]

1.Directory [ACCT2.data] has to exist;
2.After rename all files and subdirectory are moved in new folder
3.Directory [ACCT1.DATA] stay empty
4.Directory [ACCT2.DATA] contains all files and directory.

Antonio Vigliotti
Antonio Maria Vigliotti
Robert Gezelter
Honored Contributor

Re: rename path issue [ newbie question]

Nipun,

I believe that Hein mis-spoke (wrote).

Obviously, before doing any of these operations with real files, create a sample directory tree with a population of files and experiment until you are comfortable that you understand what is happening.

It takes only a few seconds to create a group of nested subdirectories a few levels deep, each with some non-directory files. Do the RENAME/LOG operation on this tree and you will see how the mechanics of RENAME operate without working with live data.

- Bob Gezelter, http://www.rlgsc.com
Antoniov.
Honored Contributor

Re: rename path issue [ newbie question]

Just for talking,
I never use full path, I usually use path from current directory.
So I didn't read ACCT1/2 is just a level above the current you want to rename.

Antonio Vigliotti
Antonio Maria Vigliotti
Dale A. Marcy
Trusted Contributor

Re: rename path issue [ newbie question]

Maybe I am reading this thread incorrectly, but it sounds to me like all Nipun really wants to do is:

$ rename/log disk1:[000000]acct1.dir disk1:[000000]acct2.dir

I prefer to add /log to all my copy/rename/delete commands.
Hein van den Heuvel
Honored Contributor
Solution

Re: rename path issue [ newbie question]

Jan> To this, Hein answered "Yes". I am sorry, but have to ABSOLUTELY disagree!!
Rob> I believe that Hein mis-spoke (wrote).

You guys are right. I mis-read.
I _thought_ he had pre-created an empty directory, which would have to be removed.
My bad.

Dale> all Nipun really wants to do is:
> $ rename/log disk1:[000000]acct1.dir disk1:[000000]acct2.dir

Yes, but he is 'nervous' about it.

Nipun> rename disk1:[acct1.data]dirTOMOVE.dir - disk1:[ACCT2.data]
Nipun> won't this entirely solve my problem?

YES

> Basically, it will copy all the contents and sub directories of dirTOMOVE.dir to disk1:[ACCT2.data]

NO. But this is semantics / nit picking.
It will NOT copy contents or subdirectories.
It will only rename that top directoy.
But that contents and those subdirectories will become visible, will get a path, under that new top just like you desire.
So the desired effect will be there with a single, reversible, sub-second command.

Sorry 'bout mis-reading earlier.
Hein.




Vladimir K. Vershinin
Frequent Advisor

Re: rename path issue [ newbie question]

You can use VTfm from
http://www.vtfm.narod.ru