|
|
MPE/iX Commands Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 5 Command Definitions L-ONEWLINK |
|
Creates a link to a file, group, account, or directory. (Native Mode)
You can use the NEWLINK command to create a link to a file, group, account, or directory. 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 Table 5-7 “CI Commands Affected by Symbolic Links” below:
Table 5-7 CI Commands Affected by Symbolic Links
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. The following tree structure will be used to construct the examples that follow it. Assume that the CWD is /ACCT1/PUB.
To create a symbolic link named PAYCODE to the file PAYROLL.CODE.SOFTWARE, enter the following command:
Or, optionally use the positional parameters and enter:
You now can access PAYROLL.SAFE.SOFTWARE through PAYCODE. For example, if you have read access to the file PAYROLL.CODE.SOFTWARE, you may enter the following command to print the contents of the file:
To create a symbolic link named FARFILE in PUB.ACCT1 that references /SOFTWARE/CODE/dir2/f1, enter the following command:
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:
By creating a symbolic link to the file, you can simplify what users need to type to print it. For example:
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 follows:
Then, to get a list of the files under /acct1/dir1/, the user enters:
Absolute symbolic links The following command creates FILE3 as a symbolic link to the nonexistent file SOURCE1.CODE.SOFTWARE.
The following command creates a symbolic link FILE4 as a link to an existing file.
The following command creates /ACCT1/PUB/softPUB which points to /SOFTWARE/PUB, which is the group PUB in SOFTWARE account:
The following command creates the symbolic link FILE9 as a link to the root directory:
Relative symbolic links The following examples show how to create symbolic links that are relative to the current working directory (CWD). For these examples assume that CWD is /SOFTWARE/CODE/dir2 The following command creates a symbolic link /SOFTWARE/CODE/F1 which points to the file ./f1:
The following command creates a symbolic link /SOFTWARE/CODE/F2 which points to the file ./f2:
The following command creates the link /SOFTWARE/CODE/dir2/dir which points to the directory ../../../dir:
If you enter the following command, you will get an error message:
Similarly, the following command also generates an error message:
|
|