Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!mtune!codas!novavax!murphy!dave From: dave@murphy.UUCP (Snipe Hunter) Newsgroups: comp.unix.wizards Subject: Re: symbolic links are a botch Message-ID: <390@murphy.UUCP> Date: Wed, 10-Jun-87 09:39:29 EDT Article-I.D.: murphy.390 Posted: Wed Jun 10 09:39:29 1987 Date-Received: Sat, 20-Jun-87 06:01:20 EDT References: <2629@ulysses.homer.nj.att.com> Organization: Gould CSD, Fort Lauderdale, FL Lines: 40 Keywords: file system, file name resolution Summary: please do it in the shell, not in the kernel Hmmm...I've never had much trouble with this. I have been surprised before by passing through a symbolic link when cd'ing, and finding myself in a totally different place, but on my personal annoyance scale it doesn't rank nearly as high as, say, the backwards arguments to strcpy. Treating ".." as an operator in the shell's cd command does sound like a nice idea, though. I assume you would have some sort of a stack of directory names and use that to handle "..". As long as it doesn't create a directory-depth limitation, fine. You might want to consider making it an option, turned on and off by setting a variable or something. I would also like to see an option to have the shell issue a warning message whenever you pass through a symlink. I'm not so sure I feel comfortable with treating ".." specially in the kernel, though. The reason is that, if you do that, then if you have a symlink which contains ".." in its resolution path, the place that ".." refers to can be different depending on how you got there. Here's an example: you have a directory "/foo" which contains a file "f.c". This file is a symbolic link that points to "../bar/f.c". Now, if you cd into "/foo" without passing through a symlink, there is no problem with "f.c"; if you more it, you get the contents of "/bar/f.c". However, now suppose you have another directory "/xyzzy" with a symlink "plugh" which points to "/foo". If I understand your proposal correctly, if you cd to "/xyzzy" and then to "plugh", getcwd will report that your current directory is "/xyzzy/plugh", not "/foo". The problem comes when you try to access "f.c"; the symlink will refer not to "/bar/f.c", but to "/xyzzy/bar/f.c", which doesn't exist. Does this make sense, or have I misunderstood you completely? --- "Country beats the hell out of me" -- Jerry Dale McFadden Dave Cornutt, Gould Computer Systems, Ft. Lauderdale, FL [Ignore header, mail to these addresses] UUCP: ...!{sun,pur-ee,brl-bmd,seismo,bcopen,rb-dc1}!gould!dcornutt or ...!{ucf-cs,allegra,codas,hcx1}!novavax!gould!dcornutt ARPA: dcornutt@gswd-vms.arpa "The opinions expressed herein are not necessarily those of my employer, not necessarily mine, and probably not necessary."