home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / sys / 3b1 / 4376 < prev    next >
Encoding:
Text File  |  1993-01-24  |  5.5 KB  |  120 lines

  1. Newsgroups: comp.sys.3b1
  2. Path: sparky!uunet!ceilidh!dnichols
  3. From: dnichols@d-and-d.com (DoN. Nichols)
  4. Subject: Re: link vs ln on the 3b1: what gives?
  5. Message-ID: <1993Jan23.205836.8858@d-and-d.com>
  6. Sender: usenet@d-and-d.com (Usenet)
  7. Nntp-Posting-Host: shindig
  8. Organization: D and D Data, Vienna VA
  9. References: <96804@rphroy.ph.gmr.com>
  10. Date: Sat, 23 Jan 1993 20:58:36 GMT
  11. Lines: 107
  12.  
  13. In article <96804@rphroy.ph.gmr.com> tkacik@hobbes.hobbes.cs.gmr.com writes:
  14. >In article 18394@colorado.edu, wouk@alumni.cs.colorado.edu (Arthur Wouk writes:
  15. >> ln -s does not work.
  16. >
  17. >The -s is to create soft links.  Soft links are a BSD addition, and do not
  18. >exist on the 3b1, (or any other SYS5 Unix, unless they were added by the vendor).
  19.  
  20.     Soft links are also known as symbolic links.  I believe that they
  21. are among the BSD-isms which were incorporated into SysVr4, but we can't get
  22. that for our machine, either.
  23.  
  24. >> ln a b just creates two copies of the same file with different names.
  25. >
  26. >ln does not create a second copy of the file.  It gives the single file a second
  27. >name.  If after doing 'ln a b', you change the contents of b, you will see that
  28. >a has also changes.
  29.  
  30.     Also, if you use 'ls -l', you see the count of the number of links to
  31. a file immediately to the right of the modes e.g.:
  32.  
  33. -rw-r--r--  2 root    root       6960 Apr 26  1992 libndir.a
  34. -rw-rw-rw-  1 bin     bin       76950 Jul 27  1991 libnet.a
  35. -rw-r--r--  1 bin     bin        9074 Jul 27  1991 libplot.a
  36. -rw-r--r--  1 bin     bin       44660 Jul 26  1992 libresolv.a
  37. -rw-r--r--  1 root    root       9266 Feb  8  1992 libsyslog.a
  38. -rw-r--r--  1 bin     bin      127294 Jul 27  1991 libtam.a
  39. -rw-r--r--  2 bin     bin      127248 Jul 27  1991 libtam.a.OLD
  40. -rw-r--r--  2 bin     bin        5002 Jul 27  1991 libtermcap.a
  41. -rw-r--r--  2 bin     bin        5002 Jul 27  1991 libtermlib.a
  42.             ^
  43.             |
  44.             +-- These are the link counts.
  45.  
  46.     If you add an 'i', so that it is 'ls -li', you also get the inode
  47. associated with the file, so you can *see* for sure which are the same, e.g.:
  48.  
  49.  1414 -rw-r--r--  1 bin     bin      127294 Jul 27  1991 libtam.a
  50.  1098 -rw-r--r--  2 bin     bin      127248 Jul 27  1991 libtam.a.OLD
  51.  1099 -rw-r--r--  2 bin     bin        5002 Jul 27  1991 libtermcap.a
  52.  1099 -rw-r--r--  2 bin     bin        5002 Jul 27  1991 libtermlib.a
  53.  3311 -rw-r--r--  1 bin     bin        4780 Apr 26  1992 libtomb.a
  54.  
  55. where libtam.a.OLD, libtermcap.a and libtermlib.a *all* have two links (so
  56. they can't all be the same file, only two of them.  The fact that both
  57. libtermcap.a and libtermlib.a both use inode 1099 is proof that they are the
  58. same, as long as they are on the same disk partition.  (Hard links can't
  59. cross disk partitions, because they are simply two directory entries
  60. pointing to the same inode.  In case you didn't know, the directory entry
  61. only contains the filename and the inode number, everything else is stored
  62. in the inode.  With hard links, everytime a link is deleted, the link count
  63. in the inode is decremented, and the file only vanishes from the disk when
  64. the link count goes to zero, *and* the last process that has it open closes
  65. it.
  66.  
  67.     A symbolic link requires the expandable directory slot (the SysV one
  68. always occupies 16 bytes, 2 for the inode, and 14 for the name.  In BSD
  69. systems, a filename can expand up to 255 bytes.  In the case of a symbolic
  70. link, the directory entry contains information saying "I really mean *this*
  71. path (which follows in the directory data space).  I don't know whether the
  72. fact of a symbolic link is flagged by an illegal inode number (such as 0),
  73. or by information in the inode.  I think the latter, and I think that the
  74. actual path to the file may be held in the inode if necessary.
  75.  
  76. >> is this a bug or a feature?:-)
  77. >
  78. >That is the way the SYS5 version of ln has always worked, so I guess that
  79. >it's a feature.
  80.  
  81.     Or at least earlier versions of Sys5.  As I mentioned above, I think
  82. that the symlink is present in SysVr4.
  83.  
  84. >> this is a very unsatisfactory state of affairs. how do we create soft
  85. >> links on the 3b1?
  86. >
  87. >The only way to get soft links is to get a different machine, as they do not
  88. >exist on the 3b1.
  89.  
  90.     Well, we *could* re-start the "How do I port BSD to the 3B1?" -
  91. "Can't" - "Can too" - "Where will you find enough memory to hold the kernel?"
  92. debates. :-)
  93.  
  94.     If you can't live without symlinks, then you have several choices.
  95. Two of them are:
  96. 1)    Move to BSD486 with new hardware - OS is free, hardware is new and
  97.     relatively expensive.
  98. 2)    Get an older workstation running a BSD variant.  I have several Suns
  99.     here (2/120, 3/140, 3/60, and SPARC 4/60 clone).  The 3/140 cost
  100.     less than my first 3B1 (really a 7300), considering that the Sun
  101.     came with the development system, 141MB hard drive, and 60MB tape
  102.     backup unit.  The general philosophy with Suns is:  "If you have the
  103.     hardware, you have a license to run the OS", so it is possible to
  104.     upgrade by borrowing the distribution media from someone who already
  105.     has it.  I believe that the price charged by Sun is nominally for the
  106.     distribution media, not the SunOs.  (This is all changing with the
  107.     move to Solaris 2.?, which is a Sys5r4 merged with most of Suns
  108.     BSD-based add-ons.  I haven't had a chance to use it at work yet, so
  109.     I don't know too much about it, but I do know that the development
  110.     system is no longer bundled once you hit Solaris 2.? (also known as
  111.     SunOs 5.?)).
  112.  
  113.     Good Luck
  114.         DoN.
  115. -- 
  116.  Email:   <dnichols@d-and-d.com>  |  ...!uunet!ceilidh!dnichols 
  117.          <dnichols@ceilidh.beartrack.com>
  118.  Donald Nichols (DoN.)  |   Voice (Days): (703) 704-2280 (Eves): (703) 938-4564
  119.     --- Black Holes are where God is dividing by zero ---
  120.