HPlogo Commands Reference HP 3000 Series 9X8LX Computer Systems > Chapter 2 MPE/iX Commands

NEWLINK

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

This command creates a link to a file, group, account, or directory.

SYNTAX



   NEWLINK [ LINK=] linkname [;TO=] sourceobject [ {;SYMBOLIC} ]

Parameters

linkname

The pathname that points to the file, that when created, will contain the link. linkname must resolve to a unique name. It may not be the name of an existing symbolic link, even if that link resolves to the name of a file or directory object that does not exist.

This is a required parameter. When specifying linkname, you may not use wildcard characters, file equations, or name a system defined file (such as $NULL).

sourceobject

The path name to which a link is to be created. The sourceobject does not need to exist when creating symbolic links. This path must resolve to either a file, group, account, or directory name.

Security provisions of sourceobject do not affect the creation of symbolic link(s) to sourceobject.

This is a required parameter. When specifying sourceobject, you may not use wildcard characters, file equations, or name a system defined file (such as $NULL).

SYMBOLIC is the default.

Operation Notes

You can use the NEWLINK command to create a link to a file, group, account, or directory. You can issue the NEWLINK command from a session, job, program, or in BREAK. NEWLINK requires Save Files (SF) capability, Create Directory entry (CD) and Traverse Directory (TD) permissions.

When newlink represents a path to a symbolic link, the target of that symbolic link is used as the name of the new link that is being created.

The NEWLINK command fails if the path represented by linkname points to a file or directory that already exists.

The following table lists all the CI commands that operate on files, groups, accounts, or directories and are affected by symbolic linking. Keep in mind the following data points when using the table below:

  • Typically, a symbolic link always resolves to its target name.

  • The Follow Link column applies to the filename portion (last component) of an HFS path.

Table 2-3 CI Commands Affected by Symbolic Links

Command NameFollow LinkNotes
CHGROUPNoNone
DISKUSEYes/NoLink is resolved before the operation is performed. If a symbolic link exists under the account that link is not resolved. Therefore dis k space usage of its target is not included in the calculations.
LISTACCTNoNone
LISTFILENoLink is not resolved. Therefore, operation is performed on t he name specified. LISTFILE formats 5 and 7 may be used to determine the im mediate target of a symbolic link.
LISTGROUPNoNone
NEWLINKNoThe LINK parameter may not name a symbolic name. The TO parameter is not checked at all.
PURGEYesThis behaves differently than the UNIX rm command.
PURGEACCTNo/NoLink is not resolved. Therefore, operation is performed on the specified name. If a symbolic link exists under the account, that link i s not resolved and its target is not removed.
PURGEDIRYes/NoLink is resolved before the operation is performed. If a symbolic link exists under the directory, that link is not resolved before it i s removed. Therefore, its target is not affected.
PURGEGROUPNo/NoLink is not resolved. Therefore, operation is performed on the specified name. If a symbolic link exists under the account that link i s not resolved and its target is not removed.
REPORTNoLink is not resolved. Therefore, operation is performed on the name specified. Note that REPORT treats its first parameter as a group nam e. Therefore, if a link name is specified, that name is treated as a group name regardless of the type of its target.
RESTORENoLink is not resolved. Therefore, operation is performed on the name specified.
STORENoLink is not resolved. Therefore, operation is performed on the name specified.

 

Examples

The following tree structure will be used to construct the examples that follow it. Assume that the CWD is /ACCT1/PUB.



                                   ROOT

                      --------------|-------------

                     |              |             |

                   ACCT1           dir         SOFTWARE

                     |             / \            |

              ---------------     f1 f2   ------------------

             |               |           |                  |

            PUB            dir1         PUB                CODE

             |            /    \         |                  |

         ---------     file1  file2    ACCTORG   -----------------------

        |         |                             |      |        |       |

     ACCTUDC    FILE3                        COMMON  TERMIO  COMPALL   dir2

                                                                      / |  \

                                                                    f1 f2 dir3

To create a symbolic link named PAYCODE to the file PAYROLL.CODE.SOFTWARE, enter the following command:

    :NEWLINK LINK=PAYCODE; TO=PAYROLL.CODE.SOFTWARE



  or optionally use the positional parameters and enter



    :NEWLINK PAYCODE, PAYROLL.CODE.SOFTWARE

In this example, the file PAYCODE.PUB.ACCT1 will be created as a symbolic link to file PAYROLL.CODE.SOFTWARE. The user now can access PAYROLL.SAFE.SOFTWARE through PAYCODE. For example, the user may enter the following command:

   :PRINT PAYCODE

This command will print the contents of the file PAYROLL.CODE.SOFTWARE given that this file allows read access to the user.

To create a symbolic link named FARFILE in PUB.ACCT1 that references /SOFTWARE/CODE/dir2/f1, enter the following command:

   :NEWLINK LINK=FARFILE; TO=/SOFTWARE/CODE/dir2/f1

Suppose that file COMMON.CODE.SOFTWARE contains information that is used frequently. To display the contents of the file the following command has been used:

   :PRINT COMMON.CODE.SOFTWARE

With the availability of the links, the following can be done from the current logon group or CWD:

   :NEWLINK COMMON, COMMON.CODE.SOFTWARE



   :PRINT COMMON

Suppose that a user is currently logged on as USER1 in the group PUB.SOFTWARE. To access the files in /ACCT1/dir1 directory without entering the full path name each time, USER1 may establish a link named "morecode" to that directory as following:

   :NEWLINK LINK=./morecode; TO=/ACCT1/dir1

To get a list of the files under /acct1/dir1/, the user enters:

   :LISTFILE ./morecode/

The following examples demonstrate the behavior of this command.



   In the following examples the notation "--->" means "which points to".



   Part 1: Absolute symbolic links



     :NEWLINK LINK=FILE3.PUB.ACCT1; TO=SOURCE1.CODE.SOFTWARE

     Creates FILE3 ---> SOURCE1.CODE.SOFTWARE as a link to a nonexisting file.

     Note that it is allowed to create links to objects that do not yet exist



     :NEWLINK LINK=FILE4.PUB.ACCT1; TO=/SOFTWARE/CODE/dir2/f1

     Creates FILE4 ---> /SOFTWARE/CODE/dir2/f1 as a link to a file



     :NEWLINK LINK=/ACCT1/PUB/softPUB; TO=/SOFTWARE/PUB

     Creates /ACCT1/PUB/softPUB ---> /SOFTWARE/PUB as a link to group PUB in

     SOFTWARE account



     :NEWLINK LINK=FILE9.PUB.ACCT1; TO=/

     Creates FILE9 ---> / as a link to the root





   Part 2: Relative symbolic links

 

     For these examples assume that CWD=/SOFTWARE/CODE/dir2





     :NEWLINK LINK=../F1; TO=./f1

     Creates /SOFTWARE/CODE/F1 ---> ./f1 as a link to a file





     :NEWLINK LINK=F2.CODE; TO=./f2

     Creates /SOFTWARE/CODE/F2 ---> ./f2 as a link to a file





     :NEWLINK LINK=./dir; TO=../../../dir

     Creates /SOFTWARE/CODE/dir2/dir ---> ../../../dir as a link to a directory



     :NEWLINK LINK=FILE1.PUB.ACCT1; TO=/dir/f1

     Duplicate name in directory. (CIERR 906)



     Assume CWD=/SOFTWARE/CODE/dir2.

     :NEWLINK LINK=../TERMIO; TO=./f1

     Duplicate name in directory. (CIERR 906)

Related Commands



   PURGELINK

   PURGE

   LISTFILE
Feedback to webmaster