


_O_n_l_i_n_e _M_a_n_u_a_l             User Commands                     ln(1)



NNNNAAAAMMMMEEEE
     ln - create file link

SSSSYYYYNNNNTTTTAAAAXXXX
     llllnnnn [[[[ ----hhhhssssffff ] _t_o-_n_a_m_e [ _f_r_o_m-_n_a_m_e ]
     llllnnnn [[[[ ----hhhhssssffff ] _t_o-_n_a_m_e-_l_i_s_t _d_i_r_e_c_t_o_r_y

DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
     The TX operating system supports hard links and symbolic
     links.  Hard links are the default.

     ----hhhh   Create a hard link.  This is the default.

     ----ssss   Create a symbolic link.

     ----ffff   Force override of protection.

     _t_o-_n_a_m_e
          Names an existing file referred to by the link.

     _f_r_o_m-_n_a_m_e
          Names the link, which will be built in the current
          directory.  By default, (_f_r_o_m-_n_a_m_e not specified) the
          link is placed in the current directory using the same
          last component of the linked-to filename.

     _t_o-_n_a_m_e-_l_i_s_t
          Lists one or more names of previously existing files
          that will be linked from the named directory.  The
          links will have the same name (last component) as the
          linked-to file.

     CCCCoooommmmmmmmoooonnnn PPPPrrrrooooppppeeeerrrrttttiiiieeeessss
     Links do not depend on a specific file system location.
     This is true for both hard links and symbolic links.  The
     file can be moved to a different location (retaining the
     same directory structure) without invalidating the link.

     One file can have several links.  Each link may have a dif-
     ferent name.  (All links to the same file yield the same
     information: size, permissions, owner, for example.)

     If _f_r_o_m-_n_a_m_e exists and its mode forbids writing (for exam-
     ple, read-only), the following message displays on the
     screen:

          ln: override permission nnn for file2? (y/n)

     where _n_n_n represents the octal notation for the mode. The
     user types 'y' to override the protection and create the
     link. Typing any other character cancels the link request.
     The link is created without question as long as the user
     owns the file and the standard input in not a terminal. The
     ----ffff option creates the link without question as long as the
     user owns the file.

     HHHHaaaarrrrdddd LLLLiiiinnnnkkkk PPPPrrrrooooppppeeeerrrrttttiiiieeeessss
     A hard link is a normal directory entry representing a file
     that may also be linked from other directories.  There is no






     difference between a file and a hard link to the same file.

     Hard links have these restrictions:  1) they may not span
     file systems; 2) they may not refer to directories.

     The disk blocks that contain the actual data referenced by a
     hard link remain until all hard links to the file are
     removed.  Therefore, removal of the linked-to file of a hard
     link has no effect.

     SSSSyyyymmmmbbbboooolllliiiicccc LLLLiiiinnnnkkkk PPPPrrrrooooppppeeeerrrrttttiiiieeeessss
     A symbolic link is a special kind of file that contains the
     pathname of the linked-to file.  A symbolic link is effec-
     tive only if the referenced file exists.  Removing the
     referenced file of a symbolic link results in a pointer to a
     nonexistent file.

     Symbolic links may span file systems.

     Symbolic links may refer to directories.

     PPPPrrrrooooggggrrrraaaammmmmmmmiiiinnnngggg IIIInnnnffffoooorrrrmmmmaaaattttiiiioooonnnn
     Every operation on a hard link to a file has the same effect
     as performing the operation on the file itself.  However,
     disk deallocation is done only on the last _u_n_l_i_n_k system
     call.

     When an _o_p_e_n call is performed on a symbolic link, the
     referenced file is used (not the link itself).  A _s_t_a_t sys-
     tem call on a symbolic link returns the linked-to file; an
     _l_s_t_a_t system call must be done to obtain information about
     the link.  The _r_e_a_d_l_i_n_k system call may be used to read the
     contents of a symbolic link.

SSSSEEEEEEEE AAAALLLLSSSSOOOO
     User Commands (1):  rm, cp, mv
     System Calls (2):  lstat, readlink, stat, symlink

March 1989                                    TX User's Reference





















