>>-v_symlink--vntoken--filename--pathname--+---------+---------><
'-extlink-'
Function
v_symlink invokes the v_symlink callable service to create
a symbolic link to a pathname or external name. The contents of the
symbolic link file is pathname.
Parameters
- vntoken
- A variable name for the directory that contains the vnode token
in which filename is being created.
- filename
- The name for the symbolic link.
- pathname
- The absolute or relative pathname of the file you are linking
to (the contents of the symbolic link).
- extlink
- Specify 1 if this is a symbolic link to an external name rather
than to a pathname in the file hierarchy. An external name is the
name of an object outside of the file hierarchy.
Usage notes
- Like a hard link (described in v_link), a symbolic
link allows a file to have more than one name. The presence of a hard
link guarantees the existence of a file, even after the original name
has been removed. A symbolic link, however, provides no such assurance;
in fact, the file identified by pathname need not exist when
the symbolic link is created. In addition, a symbolic link can cross
file system boundaries, and it can refer to objects outside of a hierarchical
file system.
- When a component of a pathname refers to a symbolic link (but
not an external symbolic link) rather than to a directory, the pathname
contained in the symbolic link is resolved. For v_rpn or other z/OS UNIX callable
services, a symbolic link in a pathname parameter is resolved as follows:
- If the pathname in the symbolic link begins with / (slash), the
symbolic link pathname is resolved relative to the process root directory.
- If the pathname in the symbolic link does not begin with /, the
symbolic link pathname is resolved relative to the directory that
contains the symbolic link.
- If the symbolic link is not the last component of the original
pathname, remaining components of the original pathname are resolved
from there.
- When a symbolic link is the last component of a pathname, it may
or may not be resolved. Resolution depends on the function using
the pathname. For example, a rename request does not have a symbolic
link resolved when it appears as the final component of either the
new or old pathname. However, an open request does have a symbolic
link resolved when it appears as the last component.
- When a slash is the last component of a pathname, and it is preceded
by a symbolic link, the symbolic link is always resolved.
- Because it cannot be changed, the mode of a symbolic link is ignored
during the lookup process. Any files and directories to which a symbolic
link refers are checked for access permission.
- The external name contained in an external symbolic link is not
resolved. The filename cannot be used as a directory component
of a pathname.
Example
In the following example, assume that
dirtok, file, and
linkname were assigned values earlier in the exec:
"v_symlink dirtok (file) (linkname)"