[comp.sys.amiga] Filesystem Links.

peter@sugar.hackercorp.com (Peter da Silva) (06/28/89)

In article <112459@sun.Eng.Sun.COM>, page%swap@Sun.COM (Bob Page) writes:
> strengths and limitations.  Under the Amiga FS in the non-existant
> v1.4, all links are soft links.  However, UNIX-heads have come to
> think of soft links as being able to cross file systems, and the FS
> links under the non-existant v1.4 don't.

Why not? because they're really hard links but don't have all the UNIX
semantics?
-- 
Peter "Have you hugged your wolf today" da Silva      `-_-'
...texbell!sugar!peter, or peter@sugar.hackercorp.com  'U`

KENNEDAM%WWPS@dupont.com (Tony Kennedy) (06/30/89)

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? 

Sorry if this isn't the appropriate place for this but it's the only usenet
conference I get.


			Thanks...Tony
>-----------------------------------------------------///----------------< 
|    Tony Kennedy      | Any resemblance       |     /// AMIGA           | 
|   Project Engineer   | between these and my  |\\\ /// The computer     |  
|    Setpoint Inc      | employers opinions is | \\X// For the best      | 
|                      | pure coincidence.     |  \X/ of us.             | 
>------------------------------------------------------------------------<  
| INTERNET : kennedam%wwps%dupont.com@relay.cs.net                       |  
>------------------------------------------------------------------------<  
| A computer can make as many mistakes in 20 seconds as 20 men working   |  
| for 20 years.                                                          |  
>------------------------------------------------------------------------<

elg@killer.DALLAS.TX.US (Eric Green) (06/30/89)

From article <3961@sugar.hackercorp.com>, by peter@sugar.hackercorp.com (Peter da Silva):
> In article <112459@sun.Eng.Sun.COM>, page%swap@Sun.COM (Bob Page) writes:
>> strengths and limitations.  Under the Amiga FS in the non-existant
>> v1.4, all links are soft links.  However, UNIX-heads have come to
>> think of soft links as being able to cross file systems, and the FS
>> links under the non-existant v1.4 don't.
> 
> Why not? because they're really hard links but don't have all the UNIX
> semantics?

I have no direct line into Amiga, obviously, but thinking on how I
would personally implement file system links, I can think of two
seperate possibilities:

1) You're right, they're really "hard", i.e. in the file header block,
instead of the pointers to sectors, there's a single pointer to the
file header block of the REAL file, or

2) the file header block contains a symbolic name, which the DOS
handler then uses to find the real file on the device. However, if the
symbolic name refers to a file on another device, the DOS handler
would then have to send a DosPacket to the DOS handler in charge of
that other device. I see no reason why it wouldn't be doable -- but
they might have run out of time or some similar problem.

Note that I haven't looked at the docs from the latest DevCon, so I
have no idea whether this is covered there. I suspect that it is,
sigh...

--
    Eric Lee Green              P.O. Box 92191, Lafayette, LA 70509     
     ..!{ames,decwrl,mit-eddie,osu-cis}!killer!elg     (318)989-9849    
"I have seen or heard 'designer of the 68000' attached to so many names that
 I can only guess that the 68000 was produced by Cecil B. DeMille." -- Bcase

scotth@sgi.com (Scott Henry) (06/30/89)

K> Sender: mmdf@udel.EDU

K> Warning!!! Ignorant question ahead...

K> Would someone explain the difference (or similarity) between Unix links and
K> VAX/VMS logicals? In VMS I can define a logical to point to a file on a system
K> across decnet or on another disk and all I have to do is refer to it by the
K> logical name. Are links the same/similar/completely different? 

K> Sorry if this isn't the appropriate place for this but it's the only usenet
K> conference I get.

VMS logical names are (as near as I can tell) EXACTLY the same as Amiga
ASSIGN's (except for some of the open() funtionality). VMS can fake SOME
of the functionality of file links by the use of logical names because the
open("name") function first looks for a logical name "name" to open (IF it
meets the syntactic requirements for a logical name) before it tries to
open a file by that name. Because of the syntactic differences between
logical names and files, this is not a fully general solution. On unix, a
file link (either hard or soft) has exactly the same syntax as a file
(because it IS a file), so there are no non-file-system restrictions on
access. For both logical names and soft (or symbolic) links, there is a
physical distinction between the file and its "alias", as they are
distinguishable. They may also cross file-system boundaries.  Hard links
are exactly the same as the "original" file, and there is literally no way
to tell the "original" from the link. Hard links may not cross file-system
boundaries.  I expect that AmigaDos links will be somewhere between hard
and soft links, both in syntax and functionality.

I figured out how to make hard links under OFS (V1.1), but I didn't
implement it because I couldn't figure out how to keep the disk validator
from complaining, and declaring the disk corrupt...

I hope this clears up some of the fog...

K>			Thanks...Tony
--
         Scott Henry <scotth@sgi.com>
#include <std_disclaimer.h>

misterx@sun.ufnet.ufl.edu ( ) (07/01/89)

In article <18765@louie.udel.EDU> KENNEDAM%WWPS@dupont.com (Tony Kennedy) writes:
>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? 
>>-----------------------------------------------------///----------------< 
>|    Tony Kennedy      | Any resemblance       |     /// AMIGA           | 
>| INTERNET : kennedam%wwps%dupont.com@relay.cs.net                       |  

The equivalent of a hard link in UNIX is the SET FILE/ENT= command
(which BTW works better in v5+ than before but it can still bite you).
I do not really know about the soft link, I don't think there is a VMS
equivalent. I can not find a equivalence for logicals, however 
some shells may allow the use of something like them, but there is no
kernel support.

--
"One, you lock the target. Two, you bait the line. Three, you slowly
spread the net. And four, you catch the man."
UUCP: ...!gatech!uflorida!sun.ufnet.ufl.edu!misterx  
Internet: misterx@sun.ufnet.ufl.edu | vishnu@pine.circa.ufl.edu

darin@nova.laic.uucp (Darin Johnson) (07/01/89)

>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.

jms@tardis.Tymnet.COM (Joe Smith) (07/06/89)

On comparing VMS logicals to file links:
  The VMS logical name is stored as part of your job - it goes away when
  you log out and other jobs cannot use your logicals.

  A file system link is stored on the disk.  It is visable to anyone who
  looks at your directory and stays around after you log out.
-- 
Joe Smith (408)922-6220 | SMTP: JMS@F74.TYMNET.COM or jms@tymix.tymnet.com
McDonnell Douglas FSCO  | UUCP: ...!{ames,pyramid}!oliveb!tymix!tardis!jms
PO Box 49019, MS-D21    | PDP-10 support: My car's license plate is "POPJ P,"
San Jose, CA 95161-9019 | narrator.device: "I didn't say that, my Amiga did!"