home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / os / linux / 22435 < prev    next >
Encoding:
Text File  |  1993-01-02  |  2.7 KB  |  61 lines

  1. Newsgroups: comp.os.linux
  2. Path: sparky!uunet!elroy.jpl.nasa.gov!ucla-cs!twinsun!junio
  3. From: junio@twinsun.com (Jun Hamano)
  4. Subject: Re: A discipline for packages
  5. In-Reply-To: vince@halcyon.com's message of Sat, 2 Jan 1993 05:57:44 GMT
  6. Message-ID: <bk^Q7dBX@twinsun.com>
  7. Sender: usenet@twinsun.com
  8. Nntp-Posting-Host: shadow
  9. Organization: Twin Sun, Inc. (El Segundo CA)
  10. References: <T8BmwB1w165w@kf8nh.wariat.org> <1992Dec31.022954.5807@sol.UVic.CA>
  11.     <1993Jan1.201620.26986@nwnexus.WA.COM>
  12.     <1993Jan1.212511.20678@sol.UVic.CA>
  13.     <1993Jan2.055744.26567@nwnexus.WA.COM>
  14. Date: Sat, 2 Jan 1993 09:44:24 GMT
  15. Lines: 44
  16.  
  17.    why is a soft link that uses maybe an inode worse than a hard link that
  18.    uses real disk space, right ?
  19.  
  20. Though the reason original poster stated that a symbolic link is
  21. a system administrators nightmare is _not_ diskspace concern, a
  22. symbolic link is worse than a hard link in that aspect, too.  In
  23. traditional implementation of symbolic link and hard link in
  24. UNIX, which I believe linux also uses, a symbolic link uses a
  25. directory entry storing an inode, and the inode points at a
  26. single block (in minix fs linux uses, it's 1K) to store the name
  27. of the target file it is pointing at.  A hard link uses only one
  28. directory entry and shares the same inode the target file is
  29. using.  The data blocks are shard, of course, because they are
  30. using the same inode.  There was an interesting discussion in
  31. comp.os.bsd newsgroup a couple of weeks back, suggesting that a
  32. pathname shorter than 60 or so bytes (the length of the space
  33. allocated in an inode that is usually used for storing block
  34. pointers) could be stored in an inode itself without wasting a
  35. whole block; I thought it would be a reasonable thing to do.
  36.  
  37. Two more important reasons why a symbolic link is a nightmare
  38. are:
  39.  
  40. (1) with a hard link, you can tell a file is pointed at by
  41. somebody else by looking at the target file, but a target file a
  42. symbolic file is pointing at doesn't know it is pointed at by
  43. somebody else at all; after removing such a file, the symbolic
  44. link pointing to it becomes an useless dangling link (it points
  45. to an non-existent file).  With a hard link, you don't have this
  46. problem; the original disappears from the directory structure,
  47. but the file itself is not removed as long as any hard link is
  48. pointing to it.
  49.  
  50. (2) with symbolic links, you have to be very careful not to tar
  51. off symbolic links without tarring the originals they are
  52. pointing at (unless the targets are well-known places in the
  53. directory tree); otherwise, when you unpack the tar archive, you
  54. will have only pointers and no real data ---useless dangling link
  55. again.
  56. --
  57.       |
  58.    __-+-__      Jun Hamano
  59. _-+ (|o|) +-_   junio@twinsun.com
  60.   !   .   !
  61.