From: mharris AT blackwidow DOT saultc DOT on DOT ca Date: Mon, 10 Feb 1997 07:28:41 -0500 (EST) Reply-To: mharris AT blackwidow DOT saultc DOT on DOT ca To: "Paul J. Thompson" cc: opendos-developer AT mail DOT tacoma DOT net Subject: Re: [opendos-developer] unix directory links in OD??? In-Reply-To: Message-ID: Organization: Total disorganization. MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-opendos AT mail DOT tacoma DOT net Precedence: bulk On Thu, 6 Feb 1997, Paul J. Thompson wrote: > I was thinking today how useful the directory links from unix would be in > dos (OD). Now, I don't remember the exact name of what they are called, > but it should be added to the improvement list. I am sure it would be a > very simple addition... Symbolic links (soft links), and hard links. Every file in a UNIX filesystem is given a unique number called an inode number. A directory entry points to that inode. When a HARD link is made on a file, 2 directory entries end up being the exact same file. for example: file1.txt allready exists $ ln file1.txt file2.txt This creates a hard link between file1.txt and file2.txt. There is only one copy of the file stored on the disk, however that file has 2 directory names and can be accessed by either name. The file isn't deleted from the filesystem until ALL links are removed. A symbolic link is different in that it "points" to a filename. Symlinks can thus span filesystems. However if you delete the file that a symlink points to, then the symlink now points to a non-existant file and any file accesses will generate an error. $ ln -s file1.txt file2.txt This creates a symlink from file1.txt to file2.txt. If file1.txt is deleted, then file2.txt points to a non-existant file. To implement such a "linking" mechanism in DOS would require extensive modifications. This puts the FAT filesystem out of the picture. However under a new IFS API, symlinks/hardlinks would certainly be possible. You COULD manually create 2 directory entries in a dir on your hard disk that would point to the same file in your FAT (a hardlink), however any disk maintenance software (such as CHKDSK, SCANDISK, NDD) will detect this and label it as an error. Ever hear of crosslinked files? A symlink under DOS is impossible on FAT without the IFS API, but would be a hack (ala microsloth) even if it were to be implemented in DOS FAT. Either way, those diagnostic programs would still have a fit and destroy files on you. Mike A. Harris | http://blackwidow.saultc.on.ca/~mharris Computer Consultant | My webpage has moved and my address has changed. My dynamic address: http://blackwidow.saultc.on.ca/~mharris/ip-address.html mailto:mharris AT blackwidow DOT saultc DOT on DOT ca Xwindows: Forget '95. Use a REAL GUI.