RMVLNK (Remove Link)

RMVLNK Command syntax diagram

 

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

  1. 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.
  2. You must have execute authority to each directory in the path.
  3. A directory cannot be unlinked.
  4. 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.

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.