link - phpMan

Command: man perldoc info search(apropos)  

File:,  Node: Hard Links,  Next: Symbolic Links,  Prev: Working with Directory Trees,  Up: File System Interface

14.4 Hard Links

In POSIX systems, one file can have many names at the same time.  All of
the names are equally real, and no one of them is preferred to the

   To add a name to a file, use the 'link' function.  (The new name is
also called a "hard link" to the file.)  Creating a new link to a file
does not copy the contents of the file; it simply makes a new name by
which the file can be known, in addition to the file's existing name or

   One file can have names in several directories, so the organization
of the file system is not a strict hierarchy or tree.

   In most implementations, it is not possible to have hard links to the
same file in multiple file systems.  'link' reports an error if you try
to make a hard link to the file from another file system when this
cannot be done.

   The prototype for the 'link' function is declared in the header file

 -- Function: int link (const char *OLDNAME, const char *NEWNAME)
     Preliminary: | MT-Safe | AS-Safe | AC-Safe | *Note POSIX Safety

     The 'link' function makes a new link to the existing file named by
     OLDNAME, under the new name NEWNAME.

     This function returns a value of '0' if it is successful and '-1'
     on failure.  In addition to the usual file name errors (*note File
     Name Errors::) for both OLDNAME and NEWNAME, the following 'errno'
     error conditions are defined for this function:

          You are not allowed to write to the directory in which the new
          link is to be written.

          There is already a file named NEWNAME.  If you want to replace
          this link with a new link, you must remove the old link
          explicitly first.

          There are already too many links to the file named by OLDNAME.
          (The maximum number of links to a file is 'LINK_MAX'; see
          *note Limits for Files::.)

          The file named by OLDNAME doesn't exist.  You can't make a
          link to a file that doesn't exist.

          The directory or file system that would contain the new link
          is full and cannot be extended.

          On GNU/Linux and GNU/Hurd systems and some others, you cannot
          make links to directories.  Many systems allow only privileged
          users to do so.  This error is used to report the problem.

          The directory containing the new link can't be modified
          because it's on a read-only file system.

          The directory specified in NEWNAME is on a different file
          system than the existing file.

          A hardware error occurred while trying to read or write the to

Generated by $Id: phpMan.php,v 4.55 2007/09/05 04:42:51 chedong Exp $ Author: Che Dong
On Apache
Under GNU General Public License
2018-04-23 22:51 @ CrawledBy CCBot/2.0 (
Valid XHTML 1.0!Valid CSS!