HPlogo MPE/iX Commands Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 6 Command Definitions P-R

RENAME

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

Changes the 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]]

To use HFS syntax, preceed the file name with a dot (.), or a slash (/).

newfilereference

New name of file, in the same format as oldfilereference. If you omit acctname and/or groupname, the logon account and/or group are assumed.

To use HFS syntax, preceed the file name with a dot (.), or a slash (/).

TEMP

Indicates that the old file was, and the new file will be, temporary files. If you do not specify TEMP, RENAME assumes that the files are permanent.

Operation Notes

The RENAME command changes the system file identification for a permanent or temporary disk file. You can use it to change the name of a file, to change the lockword of an MPE file, or to move any file to a different location.

MPE Files

To rename an MPE file, you must be the file's creator and have exclusive access to the file. If you specify groupname or acctname, you must have save access to the group or account. Users with System Manager (SM) capability can rename any file to any location on the system.

You can use RENAME to move native mode MPE files to HFS directories. You cannot move compatability mode MPE files to HFS directories. For example, you can use RENAME with KSAM/XL files, but you cannot use it to rename MPE V/E KSAM files.

To successfuly rename a file across group or account boundaries, you must move it within a single volume set and that volume set must be physically mounted.

When you use RENAME to move a file that does not have an ACD to a directory or to another account, an ACD is automatically created for the file to ensure that it is protected by the appropriate file access matrix of its new location.

HFS Files

To rename a file in an HFS directory, you must have delete directory entry access (DD) to the old directory and create directory entry access (CD) to the new directory.

Files in HFS directories can be renamed to files in the MPE account group structure, and they can be renamed to files in other HFS directories.

You cannot rename a directory. If either oldfilereference or newfilereference is actually a directory, you will get an error.

Spool Files

If you have access to spoolfiles, you can rename them. In this case, the name of the file changes, but the contents and links to the spooler remain the same.

Use

This command may be issued from a session, a job, a program, or in BREAK. Pressing Break has no effect on this command.

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

To change the lockword of the permanent file FILE2 from LOCKA to LOCKB, enter:

  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 have SAVE access to GROUP2 and both groups must be in the system domain or reside on the same volume set. For example, to move the file MYFILE from GROUP1 to GROUP2, enter:

  RENAME MYFILE.GROUP1,MYFILE.GROUP2

The following command renames the file dir2/doc/print.txt in the current working directory (CWD) to MYFILE in the group and account MYGROUP.MYACCT.

  RENAME ./dir2/doc/print.txt, MYFILE.MYGROUP.MYACCT

The following command renames the file FILE1 in the PUB group to new_txt in the HFS directory dir1 under the root directory.

  RENAME FILE1.PUB, /dir1/new_txt

The following command renames the KSAM XL file KSFILE in the PUB group 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

Feedback to webmaster