HTBasic Help
×
Menu
Index

LINK

Makes a hard link to a file.
 
 LINK path1 TO path2 [;PURGE]
 
Usage:
LINK "/diskless1/htb.chm" TO "/diskless2/htb.chm"
LINK Exists$ TO New$;PURGE
 
Description:
Path1 is a file specifier naming an existing file. Path2 is a file specifier naming a new directory entry to be created. LINK automatically creates a new link (directory entry) for the existing file and increments the link count of the file by one. If path2 already exists, an error is given unless the PURGE option is included.
 
With hard links, both files must be on the same file system. Both the old and the new link share equal access and rights to the underlying object. The super-user may make multiple links to a directory. Unless the caller is the super-user, the file named by path1 must not be a directory. LINK_MAX specifies the maximum allowed number of links to the file (see the UNIX man page for pathconf(2V)).
 
Because a link merely establishes a second name for a single file, operations on that file are effective for all the links to the file. In other words, if the file is changed using one of the filenames, the changes are visible through all the other filenames linked to that file. (Note that this general rule is true in all cases under HTBasic, but is not true under HP BASIC for RE-STORE and RE-SAVE.)
 
Note: LINK is not supported by HTBasic, it will return an error.
 
See Also: