Firstly: even if it would be true for ls - it's a matter of 'ls'
maintainers decision, nothing more. Especially it does not say
"foo/bar" and "foo/bar/" are same, in any manner. Only it says is ls
shows them in the same way, sometimes.

That's true. But it's like saying that 3.14159 isn't exactly pi, which
is also true. But it's a good enough approximation in many, many
cases. The ls behavior I cite is seen by users in a the vast majority
of cases.

The best example I know where this matters is rsync. If you have a
trailing slash on the source, rsync copies the contents of the directory
into the destination, not the directory itself, which is obviously a
massive difference in functionality, and a mistake you don't want to
make and have to undo (been there, done that)! But it's also very handy
having both modes available.

But that is one app which makes the distinction with a good reason.

Much more common is for them to behave synonymously, and I can think of
no good reason that they shouldn't behave synonymously in Vim.

Secondly: even ls does not show "foo/bar" and "foo/bar/" in the same
way, not always. Only if it "thinks" it does not matter. In the other
words, there is some heuristics prepared for users of ls, for their
convenience. Nothing more.

Example:
        $ mkdir -p foo/tralala
        $ ln -s tralala foo/bar
        $ touch foo/tralala/test
        $ ls -l foo/bar
        lrwxrwxrwx 1 milan users 7 Feb 21 10:20 foo/bar ->  tralala/
        $ ls -l foo/bar/
        total 0
        -rw-r--r-- 1 milan users 0 Feb 21 10:20 test

True, but a relatively unusual case.

And Vim will never even conceptually open a symlink itself for a
directory (using "breaksymlink" with 'backupcopy' makes little or no
sense in this case--and doesn't work presently due to the "illegal
filename" error anyway).

IMHO, yes, it was worth pointing out that the trailing slash thing is
merely convention adopted by many programs, so it's not something that's
provably 'wrong' with Vim, and that further thought is required. But
also, IMHO, when the further thought is given, it seems that Vim's
current behaviour is indeed a bit crazy, and we would do well to change
it and simply strip trailing slashes from filenames when they are given
(perhaps unless the entire filename is / which may be better treated as
/. perhaps).

Ben.



--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Raspunde prin e-mail lui