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:
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.
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.
Now change the name of ADOCONE back to DOCUMENT.
Enter:
RENAME ADOCONE,DOCUMENTReturn
|
Lesson 2 Exercises |
 |
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?
Rename the file OAK to ACORN. Check to see if the rename was a success.