HP 3000 Manuals

Renaming Files [ New Features of MPE/iX: Using the Hierarchical File System ] MPE/iX 5.0 Documentation


New Features of MPE/iX: Using the Hierarchical File System

Renaming Files 

You can change the names of files using the RENAME command.  When
renaming a file across directories, you need to have CD permission to the
file's new parent directory, DD permission to the file's old parent
directory, and TD permission to all directories.

You can use either HFS or MPE syntax in the RENAME command.  File names
using HFS syntax must begin with a dot (.)  or slash (/).

For example:

     :rename /users/public/hearing.fil, 
     ./hearing.doc 

This example renames the file /users/public/hearing.fil to hearing.doc in
the current working directory.

     :rename /dir2/doc/print.es, MYFILE.PUB.SYS 

This example renames the file /dir2/doc/print.es to MYFILE in the PUB
group of the SYS account.

     :rename SURVEY.PUB, ./jan/survey 

This example renames the file SURVEY in the PUB group and in the logon
account, to survey in the jan subdirectory of the current working
directory.  Note that the directory jan must already exist for this
example to work properly.

The following security considerations apply when renaming files:

   *   When renaming files, if a file has an ACD, the ACD remains the
       same for the renamed file.

   *   If you rename a file with no ACD to another group in the same
       account it will not be assigned an ACD.

   *   If you rename a file having no ACD from one MPE account to another
       account, to an HFS directory, to the account, or to root, the
       system assigns an ACD that is an interpretation of the file access
       matrix in effect for the original file.  For example, @.@ access
       is interpreted as any user +RACD; $GROUP and $GROUP MASK access is
       assigned to any user, AC user, and RACD; $OWNER receives all
       access + RACD.

Table 7-2  summarizes file security changes that occur at the file
level when you rename files on MPE/iX. You must have the appropriate file
access permission to rename files.

          Table 7-2.  Resulting Security When Renaming Files 

-----------------------------------------------------------------------------------------------
|                                |                                |                           |
|              From              |               To               |    Resulting Security     |
|                                |                                |                           |
-----------------------------------------------------------------------------------------------
|                                |                                |                           |
| file1.group1.acct1             | file2.group1.acct1             | Same as original file.    |
|                                |                                |                           |
-----------------------------------------------------------------------------------------------
|                                |                                |                           |
| file1.group1.acct1             | file2.group2.acct12            | Same as original file.    |
|                                |                                | Note that the group       |
|                                |                                | security may be           |
|                                |                                | different.                |
|                                |                                |                           |
-----------------------------------------------------------------------------------------------
|                                |                                |                           |
| file1.group1.acct1             | file2.group2.acct21, 2         | If file1 has no ACD, an   |
|                                |                                | ACD is assigned based on  |
|                                |                                | the file security matrix  |
|                                |                                | of the original location. |
|                                |                                | If file1 has an ACD, the  |
|                                |                                | ACD is not changed.       |
|                                |                                |                           |
-----------------------------------------------------------------------------------------------
|                                |                                |                           |
| file1.group1.acct1             | /ACCT1/GROUP1/dir1/file21, 2   | If file1 has no ACD, an   |
|                                |                                | ACD is assigned based on  |
|                                |                                | the file security matrix  |
|                                |                                | of the original location. |
|                                |                                | If file1 has an ACD, the  |
|                                |                                | ACD is not changed.       |
|                                |                                |                           |
-----------------------------------------------------------------------------------------------
|                                |                                |                           |
| /ACCT1/GROUP1/dir1/file1       | /ACCT1/GROUP1/dir2/file22      | Same (original file has   |
|                                |                                | an ACD that is not        |
|                                |                                | changed).                 |
|                                |                                |                           |
-----------------------------------------------------------------------------------------------
|                                |                                |                           |
| /ACCT1/GROUP1/dir1/file1       | /ACCT2/GROUP2/dir2/file22      | Same (original file has   |
|                                |                                | an ACD that is not        |
|                                |                                | changed).                 |
|                                |                                |                           |
-----------------------------------------------------------------------------------------------
|                                |                                |                           |
| /file1                         | /file2                         | Same (original file has   |
|                                |                                | an ACD that is not        |
|                                |                                | changed).                 |
|                                |                                |                           |
-----------------------------------------------------------------------------------------------
|                                                                                             |
|                                                                                             |
|    1.  Some users who can access FILE1 in ACCT1 may not be able to access the file in       |
|        its new location.                                                                    |
|                                                                                             |
|    2.  To access a file, you need TD entries access.  So some users previously able to      |
|        access the file may not be able to access the file in the new location.              |
|                                                                                             |
-----------------------------------------------------------------------------------------------

For example, you may want to rename a file named STATS and move it into a
hierarchical directory called /SYS/PUB/FY92.  Assuming you are in
PUB.SYS, you can perform the following steps to accomplish this.

   *   List the file and check what type of security it has.

            :LISTFILE STATS.PUB.SYS.4 

   *   Create the FY92 directory in PUB.SYS.

            :NEWDIR FY92 

   *   Rename the file into the FY92 directory.

            :RENAME STATS,./FY92/STATS 

   *   List the file again and see what the security looks like.

            :LISTFILE ./FY92/STATS,4 

The following figure shows how the file looks after it is first created.
_____________________________________________________________
|                                                           |
|                                                           |
|      :listfile stats,4                                    |
|      ************************************                 |
|      FILE: STATS.GROUP.ACCT                               |
|                                                           |
|      ACCOUNT ------  READ : ANY                           |
|                     WRITE : AC                            |
|                    APPEND : AC                            |
|                      LOCK : ANY                           |
|                   EXECUTE : ANY                           |
|                                                           |
|      GROUP --------  READ : ANY                           |
|                     WRITE : GU                            |
|                    APPEND : GU                            |
|                      LOCK : ANY                           |
|                   EXECUTE : ANY                           |
|                      SAVE : GU                            |
|                                                           |
|      FILE ---------  READ : ANY           FCODE: 0        |
|                     WRITE : ANY         **SECURITY IS ON  |
|                    APPEND : ANY           NO ACDS         |
|                      LOCK : ANY                           |
|                   EXECUTE : ANY                           |
|                                                           |
|      FOR OPERATOR.SYS: READ, WRITE, EXECUTE, APPEND, LOCK |
|                                                           |
|                                                           |
_____________________________________________________________

            

After you rename the file into an HFS directory called /ACCT/GROUP/dir1,
executing a LISTFILE command from that directory shows that an ACD has
been assigned to the file:
___________________________________________________________________
|                                                                 |
|                                                                 |
|      :chdir /ACCT/GROUP/dir1                                    |
|      :listfile ./stats,4                                        |
|      ************************************                       |
|      FILE: /ACCT/GROUP/dir1/./stats                             |
|                                                                 |
|      ACCOUNT ------  READ :                                     |
|                     WRITE :                                     |
|                    APPEND :                                     |
|                      LOCK :                                     |
|                   EXECUTE :                                     |
|                                                                 |
|      GROUP --------  READ :                                     |
|                     WRITE :                                     |
|                    APPEND :                                     |
|                      LOCK :                                     |
|                   EXECUTE :                                     |
|                      SAVE :                                     |
|                                                                 |
|      FILE ---------  READ :               FCODE: 0              |
|                     WRITE :             **SECURITY IS ON        |
|                    APPEND :               ACD EXISTS            |
|                      LOCK :                                     |
|                   EXECUTE :                                     |
|                                                                 |
|      FOR OPERATOR.SYS: READ, WRITE, EXECUTE, APPEND, LOCK, RACD |
|                                                                 |
|                                                                 |
|                                                                 |
___________________________________________________________________

            

You can display the ACD using the ACD or -2 option of the LISTFILE
command:
___________________________________________________________
|                                                         |
|                                                         |
|      :listfile ./stats,ACD                              |
|      PATH= /ACCT/GROUP/dir1/                            |
|                                                         |
|      --------------ACD ENTRIES-----------------FILENAME |
|      $OWNER                : R,W,X,A,L,RACD    stats    |
|      $GROUP_MASK           : R,X,L,RACD                 |
|      $GROUP                : R,X,L,RACD                 |
|      @.@                   : RACD                       |
|                                                         |
|                                                         |
___________________________________________________________

            



MPE/iX 5.0 Documentation