Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!voder!pyramid!leadsv!laic!nova!darin From: darin@nova.laic.uucp (Darin Johnson) Newsgroups: comp.sys.amiga Subject: Re: Filesystem Links. Message-ID: <604@laic.UUCP> Date: 30 Jun 89 23:37:38 GMT References: <18765@louie.udel.EDU> Sender: news@laic.UUCP Reply-To: darin@nova.UUCP (Darin Johnson) Organization: Lockheed AI Center, Menlo Park Lines: 50 >Warning!!! Ignorant question ahead... > >Would someone explain the difference (or similarity) between Unix links and >VAX/VMS logicals? In VMS I can define a logical to point to a file on a system >across decnet or on another disk and all I have to do is refer to it by the >logical name. Are links the same/similar/completely different? VMS logicals are nearly the same thing as "assign" in AmigaDOS. The major difference is that VMS can have a logical point to a file, or even a non-existing file. They serve basically the same purposes as they do in AmigaDOS - to easily customize how the system looks, for convenience, etc. Assignments and logical names are stored in memory and must be recreated everytime the machine reboots. UNIX links are different. In fact VMS even had a similar facility added a few years back, although it is rarely used since it causes all sorts of problems for accounting, backups, file corruption, etc. There are 2 types of links. The first type, called a hard link, is just a second directory entry to an existing file. After creating the link, there is no difference from the original file. This is the simplest to implement, since it only involves connecting a directory entry to an existing file instead of a new file. A hard link can only point to a file on the same device. A soft link is actually a special type of directory entry that contains the name of the file to link to. Since it contains the actual name of the file, a soft link can cross device boundaries. It also involves extra disk reads before the file is found. Soft links are also much more flexible (such as a soft link to another soft link). Links stick around between reboots. Links are often used the same way as logical names. For example, if a program expects to find fonts in MYFONTS:, you can define a logical name to point where you actually want the fonts. Or if it expects fonts in HD0:MYNAME, you can create a link from there to where you actually have the fonts. Links are also used when a "standard" file must be moved to a different location. Rather than recompile everything, you just leave a link in the old location to the new location. UNIX sometimes uses a trick involving links. As an example, there are some programs called 'compress' and 'uncompress' in UNIX. These programs (as can be expected) duplicate many routines. Instead of having two different files, 'compress' and 'uncompress' are 2 (hard) links to the same file. When you run either of these programs, they will find out what name you ran them under and take the appropriate action. The same sort of thing happens with the 'vi', 'ex', and sometimes 'ed' editors. There are things links can do that logical names can't, and vice-versa. What they can be used for is up to imagination. Hope this answers your questions. Darin Johnson (leadsv!laic!darin@pyramid.pyramid.com) We now return you to your regularly scheduled program.