int link(const char *pathname1, const char *pathname2);
If the existing file specifies a directory,
Upon successful completion,
Points to a path name that names an existing file.
Points to a path name that names the new directory entry to be created.
A component of either path name prefix denies search permission.
The calling process does not have permission to access the existing file.
The requested link requires writing in a directory with a mode that denies write permission.
The link named by pathname2 exists.
The pathname1 or pathname2 parameter is an invalid pointer.
A signal interrupted the call.
The number of links to the file exceeds LINK_MAX.
The length of pathname1 or pathname2 string exceeds PATH_MAX or a path name component is longer than NAME_MAX.
A component of either path name prefix does not exist.
Either pathname1 or pathname2 points to an empty string.
The file named by pathname1 does not exist.
The directory that would contain the link cannot be extended.
A component of either path name prefix is not a directory.
The file that pathname1 named is a directory,.
The requested link requires writing in a directory on a read-only file system.
The link named by pathname2 and the file named by pathname1 are on different file systems (logical drives), and the implementation does not support links between file systems.
POSIX.1 (1996), with exceptions.
Windows only supports hard links between files on local NTFS partitions.
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
PTC MKS Toolkit 10.2 Documentation Build 28.