Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!sun-barr!sun!swap!page From: page%swap@Sun.COM (Bob Page) Newsgroups: comp.sys.amiga.tech Subject: filesystem links (was: yet another 1.4 request) Message-ID: <112459@sun.Eng.Sun.COM> Date: 27 Jun 89 01:46:05 GMT References: <0933.AA0933@caleb> <1989Jun16.151408.8382@ziebmef.uucp> <3940@sugar.hackercorp.com> <19856@cup.portal.com> Sender: news@sun.Eng.Sun.COM Reply-To: page@sun.UUCP (Bob Page) Followup-To: comp.sys.amiga Distribution: na Organization: Sun Microsystems, Mountain View Lines: 69 [This really belongs someplace else. Followups to comp.sys.amiga.] >Anybody out there want to suggest a half-dozen or so uses for a soft link? Why a half-dozen? I would think one good use would be enough justification (you define "good"). I'll tell you why I use them (all the time, in fact). Because I can never remember where I put everything. If I have a document "foo" on a particular device, I might put it in doc/dev/foo ... or I might put it in dev/doc/foo. I don't want to remember where it is, I want the computer to remember for me. So I link doc/dev and dev/doc to be the same thing. Similarly for things like docs==doc and the like. From day to day I can't remember if my Amiga music directory is music/amiga or amiga/music or even amiga/audio, so I link them all together and forget about it. Another common use (for me) is to have different names for files. For example, util-v1, util-v2, util-v3 util linked to util-v2 This may seem trivial but it can be a real time-saver when you're debugging. Especially here at work where I have access to machines of different architectures, I can soft link files and directories to things like bin -> bin/sun3 and I get the right binaries by referring to 'bin'. Another use is to name one program differently based on what you want to use it for. For instance, Matt Dillon's 'backup' and 'restore' programs are the exact same code. Same with 'compress' and 'uncompress'. They know how to act based on what they are called. If you don't have links, you have to duplicate the code on the disk, so you might have two 100K files, one for compress and one for uncompress. If you have links you link them together and you're only taking 100K (plus the link overhead but that's not worth including). On the Amiga, I can think of an immediate need. I have some programs that need large data files, and they go seeking around in the data files often. One particular application, which I can't recompile, *demands* that the data files and associated utilities it calls be in the "current directory". I could just copy the whole directory to RAM:, but I don't have enough RAM to do that. In this case, I can copy just the large data file to the RAM disk, and link the name in the "current directory" to the data file in RAM. Now my application runs a lot faster because the data file is on the RAM disk, although the application program doesn't know (or care). Anyway, that's what I use links for, off the top of my head. Probably more too. > And maybe a few for a hard link? Hard links and soft (or symbolic) links are just different implementations of the same idea under UNIX, each with its own 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. So there's some effort to provide a cross-filesystem link "above" FFS, somewhere at the DOS level. This may or may not happen. And of course I'm making this up because v1.4 doesn't exist. > I can think of some trivial uses but what do you really need 'em for? You don't REALLY need them. They are a convenience. And that's what computers are all about, eh? ..bob