Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!eris.berkeley.edu!mwm From: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) Newsgroups: comp.sys.amiga.tech Subject: Re: yet another 1.4 request Message-ID: <25860@agate.BERKELEY.EDU> Date: 28 Jun 89 22:47:13 GMT References: <0933.AA0933@caleb> <1989Jun16.151408.8382@ziebmef.uucp> <18529@louie.udel.EDU> <3960@sugar.hackercorp.com> Sender: usenet@agate.BERKELEY.EDU Reply-To: mwm@eris.berkeley.edu (Mike (I'll think of something yet) Meyer) Organization: Missionaria Phonibalonica Lines: 87 In article <3960@sugar.hackercorp.com> peter@sugar.hackercorp.com (Peter da Silva) writes: , new@udel.EDU (Darren New) writes: <> always change ExNext to look for the linked-to file and make NewExNext <> return more status information. < But then what happens when the soft-link <> and the linked-to file are in the same directory? We wind up seeing and <> maybe trying to delete the same file twice? < I think this is not quite so easy as it seems. (It never is, is it? :-) < ". You quickly get annoyed at utilities that don't do that. Second rule: the default behavior for things that walk the file system tree must be chosen carefully (thought experience dictates that not following links is usually correct). If it follows links, it must keep a stack of all the directories it's currently visiting, and check to make sure it's not going to revisit one of those (this is why not following links is usually correct). In addition, each such utility must be carefully examined to see if it makes sense to add an option to do the other thing with links (the answer is usually "yes"), and deal with that. [Side note: anyone feel up to writing the ftw routine & tw program for the Amiga? It'd make life a lot nicer!] Third rule: Backup/restore programs must be made to undestand links, and deal with them properly. Unless you timestamp the link, this means saving a copy of the link (not the file it points to) every time. This is just a disk block or two, so that's no big deal. Remember, you're introducing a new file type into the system. Every program that looks at a files type must be made to deal with this type. You also have to make sure that the default behavior doesn't make existing programs die in strange ways. Now, Peter - care to define the default behavior so that my rprot (recursive protect - changes permissions on a tree) program won't 1) get upset when it finds a file that's not a directory or data file, and 2) won't die for lack of stack space if I feed it a tree with a link back to the top of the tree? Now, on users being able to delete things out from under soft links. That doesn't confuse the applications: they just find they can't open files. A "list" on the file (gotta check the permissions, ya'know) should show it's a soft link to a file that doesn't exist. On the flip side, hard links make it possible to "update" a file, and not have everyone using the updated version - because they have hard links to the original. All you have to do is delete or rename the old version before copying the new version into place. Soft links don't have that problem - they refer to a file by name, so when you open the symlink, you always get whatever file has that name. This more than makes up for the ability to delete a file without mentioning it by name.