RMVLNK (Remove Link)
Purpose
The Remove Link (RMVLNK) command removes the link to the object specified on the OBJLNK parameter. If this is the only hard link to the object, the object is removed when no longer in use. The object can be removed even if a symbolic link to it exists. The symbolic link remains until it is removed.
This command can also be issued using the following alternative command names:
For more information about integrated file system commands, see the Integrated file system topic in the File systems and management category of the Information Center.
Restrictions
- In QOpenSys, have write and execute authority to the directory containing the object. In QDLS, have *ALL authority to the object and *CHANGE authority to the parent directory. If a hard link is being unlinked, also have object existence authority to the object.
- You must have execute authority to each directory in the path.
- A directory cannot be unlinked.
- The restrictions listed above are for the OS/400 objects of the types *DDIR, *DSTMF, *SOCKET, *STMF, and *SYMLNK.
More information about restrictions for using this command can be found in the "Additional Considerations" section at the end of this command description.
Required Parameters
- OBJLNK
- Specifies the path name of the object to unlink. Multiple links can be removed with a name pattern.
The object path name can be either a simple name or a name that is qualified with the name of the directory in which the object is located. A pattern can be specified in the last part of the path name. An asterisk (*) matches any number of characters and a question mark (?) matches a single character. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes. For more information on specifying path names, refer to path names.
Example for RMVLNK
RMVLNK OBJLNK('PAY')This command removes a link named PAY.
Additional Considerations
If you use this command to remove links for an object that is in QDLS, QSYS.LIB,
or independent ASP QSYS.LIB, > additional restrictions may apply. To identify these restrictions, see the description of the other OS/400 command that can be used to delete the type of object you are removing.
- For QDLS restrictions, see the DLTDLO (Delete Document Library Object) command.
- For QSYS.LIB and independent ASP QSYS.LIB > restrictions, see the delete command for the object you are removing. In general, the name of this command is formed using the OS/400 object type value, from which you remove the character * and add the verb DLT to the beginning. For example:
- To delete an alert table, which has the object type value of *ALRTBL, see the description for the DLTALRTBL (Delete Alert Table) command for any additional restrictions.
Use the table in the Commonly used parameters - OBJTYPE parameter to identify the object type values.
Exceptions:
- The names of the delete commands for the following objects are not formed in the general manner described above, so they are supplied here for your reference:
- Object Type (Value)
- Command
- Compiler unit (*MODULE)
- DLTMOD
- File 1 (*FILE)
- DLTF
- Menu description (*MENU)
- DLTMNU
- Server storage space (*SVRSTG)
- DLTNWSSTG
1 See Exception 2.
- In the QSYS.LIB or independent ASP QSYS.LIB > file system, libraries and database files cannot be deleted using the Remove Link (RMVLNK or alias DEL or ERASE) command. However, these objects can be deleted using the Remove Directory (RMVDIR or alias RMDIR or RD) command instead.
- The following QSYS.LIB or independent ASP QSYS.LIB > object types cannot be deleted using another OS/400 command: *EXITRG, *IGCSRT, *JOBSCD, *PRDAVL, *QRYDFN, *RCT.
Error messages for RMVLNK
*ESCAPE Messages
- CPFA085
- Home directory not found for user &1.
- CPFA093
- Name matching pattern not found.
- CPFA09C
- Not authorized to object.
- CPFA0A1
- An input or output error occurred.
- CPFA0A7
- Path name too long.
- CPFA0A9
- Object not found.
- CPFA0AB
- Object name not a directory.
- CPFA0B2
- No objects satisfy request.
- CPFA0BD
- &1 links removed. &2 links failed.