HP OpenVMS SystemsUNIX Portability Initiative
A link, or directory entry, is an object in a directory that associates a file name and a version number with a specific file. All links on a volume must represent files on the same volume. With the introduction of hard link support in OpenVMS Alpha Version 7.3–1, OpenVMS now supports three kinds of links: primary links, aliases, and hard links.
OpenVMS Alpha supports files with zero or more links. The first link to a file is referred to as the primary link and is distinguished by having the directory ID and name of the link stored in the file header. Additional links are either aliases or hard links, depending on whether the volume on which the file resides has hard links enabled or disabled.
On OpenVMS Alpha systems, you can enable hard links on specific volumes. On volumes where hard links are not enabled, non-primary
links are aliases. If you choose to enable hard links, you cannot create OpenVMS aliases for files on that volume. A volume can
support either hard links or aliases, but not both. To create either a hard link or an alias for a file, use the
Whether or not a file is deleted depends on whether the volume on which the file resides has hard links enabled, and on whether a hard link to that file has been created. If hard links are enabled, a file is actually deleted when there are no more links to that file. If hard links are not enabled and you have not created an alias for a file, only one link to that file exists: the primary link.
If you create an alias for the file and you then delete the alias, the file still exists because the primary link to that file has
not been deleted. The alias is just another name in a directory for this link. Deleting the primary link deletes the file and
leaves the alias entries. Attempting to access a file through an alias link to a deleted file results in a "
With a primary link and hard links, many links exist. You delete a file when you delete both the primary link and all hard links to that file. An important related consideration is disk quota.
On OpenVMS, the size of each file is charged to the file owner’s disk quota. If other users create hard links to a file, they are
not charged disk quota. The file’s owner can delete any links to the file in directories the owner can access, whereas hard links
in other users’ directories might cause the file to be retained; the owner continues to be charged for its quota. When you enable
hard link support on an existing volume, be sure to also use the
OpenVMS supports hard links, or aliases, to directories as well as to files. Most UNIX systems limit hard links to normal files only.