home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / sys / ibm / pc / 507 < prev    next >
Encoding:
Internet Message Format  |  1992-09-09  |  3.2 KB

  1. Xref: sparky comp.sys.ibm.pc:507 comp.os.msdos.misc:5130
  2. Newsgroups: comp.sys.ibm.pc,comp.os.msdos.misc
  3. Path: sparky!uunet!wupost!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsc!cbfsb!cbnewsg.cb.att.com!rnichols
  4. From: rnichols@cbnewsg.cb.att.com (robert.k.nichols)
  5. Subject: Re: Links
  6. Message-ID: <1992Sep10.025734.25121@cbfsb.cb.att.com>
  7. Followup-To: comp.os.msdos.misc
  8. Summary: Multiple links not supported in DOS filesystem
  9. Keywords: filesystem links DOS
  10. Sender: news@cbfsb.cb.att.com
  11. Organization: AT&T
  12. References: <Bu4yFL.2KH@belay>
  13. Date: Thu, 10 Sep 1992 02:57:34 GMT
  14. Lines: 53
  15.  
  16. In article <Bu4yFL.2KH@belay> fournes@belay writes:
  17. >I don't know if this is the right group to post this to, but...
  18. >
  19. >Can anyone tell me if, under MSDOS, would it be possible to program
  20. >in file links like under Unix (with the ln command)?  ... and if so,
  21. >if there's a program/utility out there the does such a thing?
  22. ...
  23.  
  24. NOTE: Originally posted to comp.sys.ibm.pc.  Followups redirected to
  25.       comp.os.msdos.misc.
  26.  
  27. It is essentially impossible for the DOS filesystem to support hard
  28. links, ala the UNIX "ln" command.  It is perfectly possible to set up
  29. any number of links to the same cluster chain (i.e., the actual file),
  30. but there is nowhere to indicate that these multiple links are
  31. intentional, and any filesystem checking utility will detect these as
  32. "cross-linked files" and consider them errors.
  33.  
  34. The UNIX filesystem contains an additional control block, the INODE,
  35. for each file. It provides a single place to store file attributes,
  36. including, in the case, the all-important "link count," indicating the
  37. number of directory entries that point to this file.  DOS has no
  38. equivalent, and stores information about the file in the directory
  39. entry itself.  This information includes file size, time of last
  40. modification, and various flags.  If, in a DOS filesystem, multiple
  41. directory entries were allowed to point to the same file, this
  42. information would then be replicated in an unknown number of locations,
  43. and any time the status of a file changed, the OS would have to incur
  44. the inordinate burden of searching through all directories and updating
  45. any entries that pointed to this same file.
  46.  
  47. Under DOS, it would actually be a much smaller change to the filesystem
  48. to implement the BSD UNIX "symbolic link" capability, a symbolic link
  49. being just a tiny file which contains the pathname to the real file and
  50. is so flagged, allowing the operating system to "follow the link"
  51. automatically when the link is accesses.  Although symbolic links are
  52. more flexible than hard links, there are some disadvantages:
  53.  
  54.     1.    If the actual file is erased or renamed, the links are left
  55.     hanging, pointing to nothing.
  56.  
  57.     2.  In the UNIX implementation, at least, a link is a tiny file, and
  58.     a large DOS filesystem stores tiny files very inefficiently.
  59.  
  60. Of course, hard links have their disadvantages too.  (Oops, my
  61. filesystem is full!  Well I'll erase this big file that I don't need.
  62. Hmmm, the filesystem is still full.  Now where do you suppose all the
  63. other links to that file might be hiding?)  However, it is not my
  64. intention here to get into a discussion of their relative merits.  Both
  65. types have their uses.
  66.  
  67. Bob Nichols
  68. rnichols@ihlpm.ih.att.com
  69.