coreutils
[Top][All Lists]
Advanced

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

Re: Realpath resolving current folder with no-symlinks


From: João Eiras
Subject: Re: Realpath resolving current folder with no-symlinks
Date: Mon, 16 Oct 2017 13:28:46 +0200

On 16 October 2017 at 13:23, João Eiras <address@hidden> wrote:
> Howdy.
>
> An issue bit me recently. Consider the following:
>
> $ cd
> $ mkdir -p realfolder/subfolder
> $ ln -s realfolder linkedfolder
> $ cd linkedfolder
> $ realpath --no-symlinks blah
> /home/.../realfolder/blah
> $ cd subfolder
> $ realpath --no-symlinks blah
> /home/.../linkedfolder/subfolder/blah
>
> The first call to realpath resolves the relative path to "blah" to be
> an absolute path, but it is resolving symlinks for the current working
> folder (.) even though --no-symlinks is given.
>
> The second call happens inside a subfolder, not directly inside the
> linked folder and realpath is no longer resolving the symlinks for
> that one.

I forgot to tell, I tried the above in cygwin with coreutils 8.26

Meanwhile I tried in linux with coreutils 8.25 and I get

$ cd linkedfolder
$ realpath --no-symlinks blah
/home/.../realfolder/blah
$ cd subfolder
$ realpath --no-symlinks blah
/home/.../realfolder/subfolder/blah

So, in this case (linux and coreutils 8.25) the behavior is
consistent, but it still resolves symlinks against the --no-symlinks
option.

Is this by design ?

Thank you.



reply via email to

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