home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / question / 9245 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.8 KB  |  42 lines

  1. Newsgroups: comp.unix.questions
  2. Path: sparky!uunet!das.wang.com!wang!fredj
  3. From: fredj@wang.com (Fast Freddie)
  4. Subject: Re: Is it a bad idea to 'link' directories?
  5. Organization: Wang Labs, Lowell MA, USA
  6. Date: Tue, 21 Jul 92 15:05:54 GMT
  7. Message-ID: <brqv9v.2mz@wang.com>
  8. References: <1992Jul14.191511.22320@csi.uottawa.ca> <13525@auspex-gw.auspex.com>
  9. Keywords: link
  10. Sender: news@wang.com
  11. Lines: 29
  12.  
  13. guy@Auspex.COM (Guy Harris) writes:
  14.  
  15. >>Is it a bad idea to, say, link /usr/man/man1 to /usr/man/man.1,
  16.  
  17. >If "link" means "make a hard link", well, yes, it's generally not a good
  18. >idea.  Various code that deals with the file system thinks that the only
  19. >hard links to a directory are 1) the link that gives it its name, 2) the
  20. >"." link, and 3) the ".." links in its subdirectories, if any.  Adding
  21. >an additional hard link will probably confuse that code (e.g., "find").
  22.  
  23. >If "link" means "make a symbolic link", yes, it's OK (assuming, of
  24. >course, your system *supports* symbolic links; not all UNIX systems do).
  25.  
  26. The only comment that i would like to make is that if your system supports
  27. "soft"/symbolic links one *MUST* be careful *NOT* to make these links
  28. recursive or if there are several links the last should not point back to
  29. the first.  Some Unix OS's will only loop for a while than give you an
  30. error message.  Others will go on endlessly trying to resolve the recursive
  31. path name; appearing as if the process is "hung".
  32.  
  33.  
  34. >>I ask this because 'ln' doesn't let you link directories but 'link' does.
  35.  
  36. >"link" is intended to be used only by somebody who knows the above, so
  37. >it doesn't bother doing checking - it's just a wrapper around the
  38. >"link()" call.  "ln" is the one to be used by ordinary users, and may do
  39. >extra checking, e.g. making sure you don't make hard links to
  40. >directories, even if the file system code lets you (for example, if
  41. >you're super-user).
  42.