>>-link--old_path--new_path------------------------------------><
Function
link invokes the link callable service to create a hard
link to a file (not a directory); that is, it
creates a new name for an existing file. The new name does not replace
the old one.
Parameters
- old_path
- A path name, the current name for the file.
- new_path
- A path name, the new name for the file.
Usage notes
- The link service creates a link named new_path to an
existing file named old_path. This provides an alternate
path name for the existing file, so that the file can be accessed
by the old name or the new name. The link can be stored in the same
directory as the original file, or in a different directory.
- The link and the file must be in the same file system.
- If the link is created successfully, the service increments the
link count of the file. The link count shows how many links exist
for a file. If the link is not created successfully, the link count
is not incremented.
- Links are allowed only to files, not to directories.
- If the link is created successfully, the change time of the linked-to
file is updated and the change and modification times of the directory
that holds the link are updated.
Example
To create the hard link
/usr/bin/grep to
the file
/bin/grep:
"link /bin/grep /usr/bin/grep"