Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Add Link (ADDLNK) command adds a link to an object. The New link (NEWLNK) parameter specifies the name for the new link. The Object (OBJ) parameter specifies the current name of the object that is to receive the new link. After the link is established the object may be referred to by either the old name or the new name.
For more information about integrated file system commands, see the Integrated file system information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
OBJ | Object | Path name | Required, Positional 1 |
NEWLNK | New link | Path name | Required, Positional 2 |
LNKTYPE | Link type | *SYMBOLIC, *HARD | Optional, Positional 3 |
Top |
Specifies the path name of the object the user wants to add a link to. This object must exist unless a symbolic link is to be added.
For more information on specifying path names, refer to "Object naming rules" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Specifies the new path name that can be used to refer to the object. The new name must not exist.
For more information on specifying path names, refer to "Object naming rules" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Specifies whether the link is hard or symbolic.
Symbolic links can cross file systems. An object need not exist. An existing object can be deleted without removing the symbolic link.
Hard links cannot cross file systems. When all hard links to an object are removed, the space occupied by the object is freed and the object can no longer be accessed. An object cannot be removed while a hard link to it exists.
Top |
Example 1: Adding a Symbolic Link
ADDLNK OBJ('DECEMBER-1994-MONTHLY-PAYROLL-FILE') NEWLNK('PAY')
This command adds a symbolic link named "PAY" to the DECEMBER-1994-MONTHLY-PAYROLL-FILE.
Example 2: Adding a Symbolic Link to a Source File
ADDLNK OBJ('/QSYS.LIB/MYLIB.LIB/F1.FILE/P1.MBR') NEWLNK('PGM1') LNKTYPE(*SYMBOLIC)
This command adds a symbolic link from the user's current directory (not in QSYS.LIB, independent ASP QSYS.LIB, or QDLS) to a member in a source file in QSYS.LIB.
Example 3: Adding a Hard Link
ADDLNK OBJ('/QOpenSys/MYDIR/FILE1') NEWLNK('FILE2') LNKTYPE(*HARD)
This command adds a hard link from the user's current directory, with the name FILE2, to FILE1 in /QOpenSys/MYDIR.
Top |
*ESCAPE Messages
Top |