hcvv schrieb:
> I doubt if this will be ‘fixed’.
So do I, but for different reasons.
> Tilman Schmidt seees it as a bug, but
> it may also be seen as a feature. And Konquror is not alone. Bash
> follows suite:
>
> Code:
> --------------------
> boven:~ # cd /boot/
> boven:/boot # cd boot
> boven:/boot/boot # cd boot
> boven:/boot/boot/boot # pwd
> /boot/boot/boot
> boven:/boot/boot/boot #
> --------------------
No, that’s a different bug. In fact, I would even accept that as a
feature. ![:slight_smile: :slight_smile:](/images/emoji/twitter/slight_smile.png?v=12)
It’s one thing to display the path you came by instead of the canonical
path in pwd output and in the shell prompt (if you have “\w” in $PS1).
That could indeed be regarded as a feature, and can also be worked
around. (/bin/pwd will display the canonical path, so doing
"cd /bin/pwd
" will erase the shell’s memory of how you came to the
current working directory.)
It’s another thing to present a symbolic link as a real subdirectory,
as Konqueror does. That is not a feature, that is just wrong.
A symbolic link is just a reference. It is not the same as the file
or folder it refers to. Klicking on it should take you to its target,
but displaying it as if it was the target itself is just wrong and
leads to confusion, as demonstrated by the OP.
> as does *pwd *as you see. After all it shows how you came there. One
> can discuss if ‘the path how we came there’ or ‘the path with all
> symbolic links resolved’ must be shown.
The ‘path with all symbolic links resolved’ is the canonical path,
found by following the “…” links, and displayed by eg. /bin/pwd.
It is where the folder actually resides physically. In the shell,
both are available, and shell users are (or should be) aware that a
file or directory may be referenced by different paths, so that’s no
problem.
The Konqueror folder tree, OTOH, presents folders graphically as
containers possibly containing other containers. But a symbolic link
is not a container, it’s just a reference. Displaying the referenced
container in its place is misleading.
> The loop we have in our case is
> certainly not normal
Yes, it is. It’s a quite useful and frequent construct in the system
areas of Linux and other unixoid systems. Have a look in
/var/lib/ntp/var/lib for a beautiful example - but not with
Konqueror. ![:slight_smile: :slight_smile:](/images/emoji/twitter/slight_smile.png?v=12)
> and in a more normal case you would be very
> confused when you, by clicking on a subdirectory, you ends up in a
> complete different place.
But a symbolic link is not a subdirectory. You should certainly not
be confused when you end up in a different place by clicking on a
symbolic link, because that’s exactly what symbolic links are for.
The problem is that Konqueror presents symbolic links as if they
were subdirectories. That’s what’s causing the confusion.
> Example:
> In the home directory of user test there is a directory
> /home/test/music, which is a symbolic link to /multimedia/audio. Then
> as a user test you start at your Home (/home/test/) and click music.
> Now the address shows /multimedia/audio. When you do not look carefully
> and now click the up arrow you will land at /multimedia/. Surprise!
This can only come as a surprise if the user created that symbolic
link without knowing what he or she was doing. In fact, what you
describe would be the expected behaviour, and I am very surprised
that Konqueror acts differently.
> So the behaviour as we see it is not too strange after all.
Well, I do find it extremely strange to see the same folder
displayed a potentially infinite number of times, suggesting that I
have an infinite hard disk.
I also find it strange to create a
file in one place and find it appearing in many places at once.
Linux has different notions of place (folder) and roadsign (symbolic
link), and confusing the two is, well, confusing.
> All this brings us a bit away from the question: why is this looped
> symbolic link made? IMHO it may have something to do with different
> partners (maybe GRUB and/or LILO among them) think where several files
> are and that this was solved onece and for all by this link.
No, the reason in that case is to be found in the boot process:
/boot can, and in certain configurations has to, be a mounted
filesystem, ie. separate partition. During early boot, before the
filesystems get mounted, files have to be referenced by their path
within the partition, ie. the mount point must be stripped from the
path. So for example, the file /boot/vmlinuz must in that early phase
be referenced as /vmlinuz if /boot is a separate filesystem, but as
/boot/vmlinuz if it isn’t. The symbolic link “boot -> .” in /boot
avoids this distinction because now /boot/vmlinuz works no matter if
/boot is a separate partition or part of the root filesystem.
The reason for the symbolic link in /var/lib/ntp/var/lib is a different
one btw. It has to do with the possibility of running the NTP daemon in
a chroot jail. There are still other reasons for constructs like that,
all quite sensible and logical if you think about them.
HTH
Tilman
–
Tilman Schmidt t.schmidt@phoenixsoftware.de
Phoenix Software GmbH www.phoenixsoftware.de
Adolf-Hombitzer-Str. 12 Amtsgericht Bonn HRB 2934
53227 Bonn, Germany Geschäftsführer: W. Grießl