bug-fileutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"ln -s" seems counterintuitive


From: Richard Neill
Subject: "ln -s" seems counterintuitive
Date: Sun, 16 Feb 2003 21:53:41 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.3b) Gecko/20030210

Dear GNU,

I believe that the behaviour of "ln -s" is somewhat counterintuitive. It does not deal with relative paths in the same way as "cp" or "mv" do. Ideally, I would like to see a change in behavior, but if not, perhaps a mention in the man page would be good.

For example:

ln -s foo bar           #does what is expected

lns -s foo xyz/bar      #does not do what is expected.
                        #By analogy with mv,cp and other file utilities,
                        #this should create a symbolic link in xyz
                        #pointing to ./bar, not to  xyz/bar

ln -s ./foo xyz/bar     #In my understanding, stresses that I want the
                        #target to be in the current directory, NOT xyz/
                        #This doesn't happen. I would actually need to
                        #type "ln -s ../foo xyz/bar (which makes no
                        #sense!)


Ideally, I'd like to see the behaviour change, but otherwise, please document it. Symlinks seem to be like relative links in html, as opposed to the normal way of referring to paths in bash.

-----------------------------------------------------------

Another thing which is not clear is the difference between relative symlinks and absolute paths in symlinks. Eg:

ln -s foo bar                   #breaks when bar is moved elsewhere
                                #(in the general case).

ln -s /home/me/xyz/foo bar      #doesn't break if bar is moved
                                #elsewhere.

I believe that this is the correct behaviour, but it's not documented.


Lastly, symbolic and hard links act differently in these respects!

Thanks a lot

With best wishes

Richard





reply via email to

[Prev in Thread] Current Thread [Next in Thread]