HPlogo Using HP 3000 MPE/iX: Fundamental Skills Tutorial: HP 3000 MPE/iX Computer Systems > Chapter 6 Working with Files

Lesson 2 Renaming Files

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Lesson 2 presents renaming files.

  • the command to give a new name to a file: RENAME

To rename the file called DOCUMENT in your home group, first make sure you are logged on to your home group. You must also be the creator of the file in order to perform a file name change.

Enter:

   CHGROUPReturn

Then do this:

   RENAME DOCUMENT,ADOCONEReturn
NOTE: Notice the punctuation. The comma ( , ) has to be there.

Use LISTFILE to check that DOCUMENT has disappeared and that a file called ADOCONE has appeared.

   LISTFILEReturn

Safeguard against duplication

Now use RENAME to change the name of the file DRAFT to ADOCONE and see what happens when you enter:

   RENAME DRAFT,ADOCONEReturn

What happened? Did you get this error message?

   DUPLICATE PERMANENT FILE NAME (FSERR 100)

   RENAME FAILED DUE TO FILE SYSTEM ERROR, NOT RENAMED.(CIERR 373) 

The file names in any group are always unique; there can be no duplication. When the computer discovered there was a file already named ADOCONE, it refused to change the name of DRAFT to ADOCONE.

Use LISTFILE again to verify that no change has taken place in the list of files.

   LISTFILEReturn

Now change the name of ADOCONE back to DOCUMENT.

Enter:

   RENAME ADOCONE,DOCUMENTReturn

Lesson 2 Exercises

  1. Create two files, each one consisting of at least 10 lines. Name one file OAK and the other MAPLE.

    *Try to rename the file OAK to MAPLE. What happened?

  2. Rename the file OAK to ACORN. Check to see if the rename was a success.

Feedback to webmaster