RENAME [ MPE/iX Commands Reference Manual Volume I ] MPE/iX 5.0 Documentation
MPE/iX Commands Reference Manual Volume I
RENAME
Changes identity (file name, lockword, and/or group name) of a disk file.
Syntax
RENAME oldfilereference,newfilereference[;TEMP]
Parameters
oldfilereference Current name of file, written in the format:
[*]filename[/lockword][.groupname[.acctname]]
You must be the creator of the file to rename it.
A file with HFS syntax must begin with a dot (.),
or a slash (/).
newfilereference New name of file, with the same syntax rules as for
oldfilereference. If groupname is specified, it
must be one to which you have SAVE access. If
acctname and/or groupname are omitted, the logon
account and/or group are assumed.
TEMP Indicates that the old file was, and the new file
will be, temporary files. The default is that a
permanent file is assumed.
This parameter is not applicable if attempting to
rename a file to an HFS directory. Temporary files
cannot be renamed to HFS directories.
Operation Notes
The RENAME command changes the system file identification for a permanent
or temporary disk file. It can be used to change the name of a file, to
move a file from one group to another (by specifying a different group
name in the newfilereference parameter), or to change the lockword. You
cannot rename files that exist in other accounts without SM capabilities.
To rename a file, its group's volume set must be physically mounted or
the command fails. Also, you cannot rename a file across volume sets.
To rename a file, you must be the file's creator and have exclusive
access to the file (which implies lock) unless you have SM capabilities.
The RENAME command renames spoolfiles if you have access to them.
However, this is only allowed on spoolfiles that are not linked to the
spooler print queues. When the RENAME command is used on a file, the
name of the file is changed, but its contents remain the same.
Files in HFS directories can be renamed to files in the MPE account group
structure and vice versa. Also, files in HFS directories can be renamed
to files in other HFS directories. Also file creators with SM capability
are able to rename files to MPE accounts outside of their current logon
account.
In addition, the restriction that only the file's creator could rename a
file is removed for files in directories. A user with the appropriate
access is able to rename a file to and from an HFS directory as long as
the file does not have a lockword. If a file has a lockword, only the
creator is able to rename the file. Files without lockwords can be
renamed by users with delete directory entry (DD) access to the old
directory, and create directory entry (CD) access in the new directory.
NOTE The lockword restriction is only relevant to files being renamed to
and from accounts and groups, since files in HFS directories cannot
have lockwords.
If a file has ACDs, and it is renamed to an HFS directory, the new file
will have the same ACDs.
If the oldfilereference or newfilereference is actually a directory, an
error is returned. Directories cannot be renamed using the RENAME
command.
CM files and temporary files cannot be renamed to HFS directories.
Use
This command may be issued from a session, a job, a program, or in BREAK.
Pressing Break has no effect on this command.
The RENAME command does not function on MPE V/E KSAM files, but does
allow the renaming of KSAM XL files.
If an HFS file name is the oldfilereference, and the TEMP parameter is
specified, an error message is returned.
Examples
Since temporary files exist only for the duration of your current job or
session, their fully qualified file names correspond to your logon group
and account. The following example shows the command entry to change the
name of a temporary file from OLDFILE to NEWFILE, and reassign it to the
group NEWG.
RENAME OLDFILE,NEWFILE.NEWG,TEMP
Temporary files are valid only in your logon group and are stored
according to their fully qualified file names.
The following example shows the command entry to change the lockword of
the permanent file FILE2 from LOCKA to LOCKB.
RENAME FILE2/LOCKA,FILE2/LOCKB
To transfer a file from one group to another within the same account, use
the RENAME command, simply naming the new group in the second parameter.
(You must be the creator of the file or have SM capability to use this
command.) For example, to move the file MYFILE from GROUP1 to GROUP2,
you would enter:
RENAME MYFILE.GROUP1,MYFILE.GROUP2
To use RENAME in this way, you must have SAVE access to the group named
in the second parameter (GROUP2 in the previous example). In addition,
both groups must be in the system domain or both must reside on the same
volume set.
In the following example, the file dir2/doc/print.txt under the current
working directory (CWD) is renamed MYFILE in the MYGROUP group of the
MYACCT account.
RENAME ./dir2/doc/print.txt, MYFILE.MYGROUP.MYACCT
In the following example, the file dir2/doc/print.txt under CWD is
renamed to new_txt in the directory posix under the root directory. This
example assumes the user has CD access to the posix directory.
RENAME ./dir2/doc/print.txt, /posix/new_txt
In the following example, FILE1 in the PUB group is renamed to new_txt in
the HFS directory dir1 under the root directory.
RENAME FILE1.PUB, /dir1/new_txt
In the following example, KSFILE, which happens to be a KSAM XL file in
the PUB group is renamed to ksfile in the HFS directory dir1 under the
root directory.
RENAME KSFILE.PUB, /dir1/ksfile
Related Information
Commands BUILD, COPY, PURGE, PRINT
Manuals None
MPE/iX 5.0 Documentation