Article View: comp.sys.amiga.tech
Article #177Some definitions (was Re: yet another 1.4 request)
From: Doug Merritt
Date: Sun, 25 Jun 1989 17:10
Date: Sun, 25 Jun 1989 17:10
71 lines
4179 bytes
4179 bytes
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
Technical Details
Message-ID:
<390@xdos.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!motcsd!xdos!dougReferences:
<0933.AA0933@caleb> <1989Jun16.151408.8382@ziebmef.uucp> <19642@cup.portal.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!motcsd!xdos!doug From: doug@xdos.UUCP (Doug Merritt) Newsgroups: comp.sys.amiga.tech Subject: Some definitions (was Re: yet another 1.4 request) Message-ID: <390@xdos.UUCP> Date: 25 Jun 89 17:10:01 GMT References: <0933.AA0933@caleb> <1989Jun16.151408.8382@ziebmef.uucp> <19642@cup.portal.com> Reply-To: doug@xdos.UUCP (Doug Merritt) Distribution: usa Organization: Hunter Systems, Mountain View CA (Silicon Valley) Lines: 71