[an error occurred while processing this directive]

HP OpenVMS Systems

UNIX Portability Initiative
» 

HP OpenVMS Systems

OpenVMS information

» What's new on our site
» Upcoming events
» Configuration and buying assistance
» Send us your comments

HP OpenVMS systems

» OpenVMS software
» Supported Servers
» OpenVMS virtualization
» OpenVMS solutions and partners
» OpenVMS success stories
» OpenVMS service and support
» OpenVMS resources and information
» OpenVMS documentation
» Education and training

UNIX Portability

» Roadmap
» CRTL
» GNV
» File System
» Future Plans

Evolving business value

» Business Systems Evolution
» AlphaServer systems transition planning
» Alpha RetainTrust program

Related links

» HP Integrity servers
» HP Alpha systems
» HP storage
» HP software
» HP products and services
» HP solutions
» HP support
disaster proof
HP Integrity server animation
HP Integrity server animation
Content starts here
hard links

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 SET FILE/ENTER command. The essential difference between hard links and aliases is in the effect of a delete operation. What is usually referred to as deleting a file is more precisely deleting a link to that file. When a link to a file is deleted, the associated file might also be deleted.

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 "no such file" error.

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 ANALYZE/DISK/REPAIR command to ensure the proper operation of hard links.

OpenVMS supports hard links, or aliases, to directories as well as to files. Most UNIX systems limit hard links to normal files only.

Summary:

  • Similar to existing "alias" (SET FILE /ENTER)
  • Maintains link count ($DIRECTORY /LINKCOUNT to view)
  • File contents are only deleted when the last link is removed
  • » Hard Link Example (INT and SET VOLUME)