[comp.sys.amiga.tech] Some definitions

doug@xdos.UUCP (Doug Merritt) (06/26/89)

First a warning for those who know about links (definitions follow):

One problem with hard links to directories, BTW, is that they turn the
file system into a graph rather than a tree, which will cause recursive
descent directory utilities to go into infinite loops. Unix avoids this
by disallowing creation of hard links to directories (by anyone other than
the super user == system administrator), and by having the utilities that
recursively descend directory hierarchies avoid following symbolic links.

What do you want to bet that, when links appear in AmigaDos, this bug
will bite us? Certain people have made snide comments about Unix having
arbitrary limitations in this area without understanding that Unix
implements those limitations for excellent reasons, and has to go out of
its way to do so. The mentality that "Unix is bad and AmigaDos is good
and we're not going to pay any attention to the lessons learned from
Unix" is dangerous!

In article <19642@cup.portal.com> FelineGrace@cup.portal.com (Dana B Bourgeois) writes:
>As a favor to those of us who are opinionated but but a bit ignorant,
>could some kind soul define in 25 words or less what a lock, handle,
>path, hard link, and soft link are?  I can guess but it would be a
>case of a little knowledge being dangerous.   Thanks in advance.  Email
>would be OK this is not of general interest.

I'm posting because I think it *is* of general interest.

lock:	File system locks are used to get exclusive access to a file
	or directory, or to examine a file header using Examine().
	The ExNext() call, used to step through all entries in a directory,
	uses locks.
handle:	Handles are returned by the Open() call, and are used by Read(),
	Write(), etc.
path:	The full name of a file, showing its location in the file system
	as opposed to its name relative to its parent directory. An
	example might be "df1:c/list".
link:	A file system entry which refers to another file elsewhere in
	the file system. They are convenient for redirecting access to
	a file, so that you can put the file wherever you want, but have
	links to it in other places. Links are not available in AmigaDos.

	In Unix, originally there was just one kind of link, the "hard link".
	Hard links are just a filename plus a reference to where on the
	disk the file contents appear ("inodes" on Unix). All files
	have at least one link entry in a directory, because that is how
	their name is defined. If a second link with a different name is
	made to the file, there is no real difference between the two links.

	Because of this integration of links into the *definition* of what
	a file is on Unix, it also turns out that all links to a file must
	appear within the same file system as the file itself.

	This was fine as far as it went, but it is often desirable to
	create a file name which is a synonym for a file on *another*
	file system. Links which allow that were implemented in Berkeley
	Unix, and called "symbolic links" (same thing as "soft links").

	This kind of link simply specifies the path name of the actual
	file, and therefore has the added benefit that the other file
	need not exist at the time that the symbolic link is created
	(i.e. you get an error message only when you try to access the
	file through the symbolic link, and it still doesn't exist at
	that point).

	It turns out that both types of links are handy for different
	purposes, so symbolic links are an enhancement rather than a
	replacement for hard links.

Doug
-- 
Doug Merritt		{pyramid,apple}!xdos!doug
Member, Crusaders for a Better Tomorrow		Professional Wildeyed Visionary