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