Group: File Management - Library: kernel32
Establishes a hard link between an existing file and a new file. This function is only supported on the NTFS file system.
How to access a file using not its name but an alias (hard link)
BOOL CreateHardLink(
LPCTSTR lpFileName,
LPCTSTR lpExistingFileName,
LPSECURITY_ATTRIBUTES lpSecurityAttributes
);
DECLARE INTEGER CreateHardLink IN kernel32;
STRING lpFileName,;
STRING lpExistingFileName,;
INTEGER lpSecurityAttributes
lpFileName [in] A pointer to the name of a new file. This parameter cannot specify the name of a directory.
lpExistingFileName [in] A pointer to the name of an existing file to which a link points.
lpSecurityAttributes Reserved; must be NULL.
If the function succeeds, the return value is nonzero.
An additional hard link that is created with the CreateHardLink function allows you to have multiple directory entries for a file, that is, multiple hard links to the same file, which can be different names in the same directory, or the same or different names in different directories.
However, all hard links to a file must be on the same volume. Also lpFileName cannot specify the name of a directory.
See also: CreateSymbolicLink