TACL Reference Manual
Built-In Functions and Variables
HP NonStop TACL Reference Manual—429513-018
9-318
#RENAME Built-In Function
#RENAME Built-In Function
Use #RENAME to change the name of an existing disk file.
old-file-name
is the name of the disk file to be renamed.
new-file-name
is the new name for the file.
Result
#RENAME returns zero if it renames the file successfully otherwise, it returns the file-
system error that indicates the reason for the failure. If, however, the error is caused by
a missing old-file-name, or if that file does not exist, TACL displays an
“expecting the name of an existing file” message.
Considerations
•
The new file name must be on the same volume as the old file name.
•
You can rename a file only if it is not open with exclusive access and you either
have purge access to the file or are logged on as a super-group user.
•
You can use the RENAME command to change the subvolume name of a file, but
not its volume name. Disk files that are renamed stay on the same disk volume.
•
To change the volume where a file resides, copy the file to a new volume with the
FUP DUP command, then delete the original file. For details, see the File Utility
Program (FUP) Reference Manual.
•
If you try to rename a file being audited by the TMF subsystem, the attempt fails
and file-system error 80 (operation invalid) is returned.
•
Both format 1 and format 2 files can be renamed.
Example
This code renames a file and checks whether the rename was performed without
errors:
[#IF [#RENAME oldn newn] |THEN|
#OUTPUT Rename Error
]
#RENAME old-file-name new-file-name