* Stumbled upon relative name resolution across symlinks
@ 2018-11-01 22:50 Andrey Repin
2018-11-02 12:15 ` Ken Brown
2018-11-02 14:15 ` cyg Simple
0 siblings, 2 replies; 3+ messages in thread
From: Andrey Repin @ 2018-11-01 22:50 UTC (permalink / raw)
To: All
Greetings, All!
$ pwd
/home/anrdaemon/Documents/NIX/CA-tutorial/test
$ ls -ld bin ca-profile
lrwxrwxrwx 1 anrdaemon None 61 ноя 2 01:15 bin -> /home/anrdaemon/Documents/NIX/CA-tutorial/svn-working/scripts
-rwx--x--x 1 anrdaemon None 588 дек 24 2017 ca-profile
$ cat bin/../ca-profile
cat: bin/../ca-profile: No such file or directory
$ cat $( realpath -Le "bin/../ca-profile" )
# @version $Id: ca-profile 82 2014-02-08 05:24:12Z anrdaemon $
...
In simpler words, the bin directory is symlinked from elsewhere.
realpath -Le resolves correctly, but all other filesystem functions fail.
I vaguely recall that there was some discussion on the matter, but search
returns too many results, can't read them all.
My question, basically: is this expected way of things?
If so, I'd just workaround it. Sad but doable.
--
With best regards,
Andrey Repin
Friday, November 2, 2018 1:31:12
Sorry for my terrible english...
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Stumbled upon relative name resolution across symlinks
2018-11-01 22:50 Stumbled upon relative name resolution across symlinks Andrey Repin
@ 2018-11-02 12:15 ` Ken Brown
2018-11-02 14:15 ` cyg Simple
1 sibling, 0 replies; 3+ messages in thread
From: Ken Brown @ 2018-11-02 12:15 UTC (permalink / raw)
To: cygwin
On 11/1/2018 6:39 PM, Andrey Repin wrote:
> Greetings, All!
>
> $ pwd
> /home/anrdaemon/Documents/NIX/CA-tutorial/test
>
> $ ls -ld bin ca-profile
> lrwxrwxrwx 1 anrdaemon None 61 ноя 2 01:15 bin -> /home/anrdaemon/Documents/NIX/CA-tutorial/svn-working/scripts
> -rwx--x--x 1 anrdaemon None 588 дек 24 2017 ca-profile
>
> $ cat bin/../ca-profile
> cat: bin/../ca-profile: No such file or directory
>
> $ cat $( realpath -Le "bin/../ca-profile" )
> # @version $Id: ca-profile 82 2014-02-08 05:24:12Z anrdaemon $
> ...
>
> In simpler words, the bin directory is symlinked from elsewhere.
> realpath -Le resolves correctly, but all other filesystem functions fail.
I might be misunderstanding you, but are you saying that you think 'bin/..'
should resolve to the current working directory? This is not what Posix says.
See http://pubs.opengroup.org/onlinepubs/9699919799/, starting at "If a symbolic
link is encountered during pathname resolution...". The reason you got what you
wanted using 'realpath -L' is that the -L option specifically asks for that:
$ man realpath
[...]
-L, --logical
resolve '..' components before symlinks
Ken
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Stumbled upon relative name resolution across symlinks
2018-11-01 22:50 Stumbled upon relative name resolution across symlinks Andrey Repin
2018-11-02 12:15 ` Ken Brown
@ 2018-11-02 14:15 ` cyg Simple
1 sibling, 0 replies; 3+ messages in thread
From: cyg Simple @ 2018-11-02 14:15 UTC (permalink / raw)
To: cygwin
On 11/1/2018 6:39 PM, Andrey Repin wrote:
> Greetings, All!
>
> $ pwd
> /home/anrdaemon/Documents/NIX/CA-tutorial/test
>
> $ ls -ld bin ca-profile
> lrwxrwxrwx 1 anrdaemon None 61 Гîÿ 2 01:15 bin -> /home/anrdaemon/Documents/NIX/CA-tutorial/svn-working/scripts
> -rwx--x--x 1 anrdaemon None 588 äåê 24 2017 ca-profile
>
> $ cat bin/../ca-profile
> cat: bin/../ca-profile: No such file or directory
>
Try ls `bin/../`
You'll see a listing of
/home/anrdaemon/Documents/NIX/CA-tutorial/svn-working/.
> $ cat $( realpath -Le "bin/../ca-profile" )
> # @version $Id: ca-profile 82 2014-02-08 05:24:12Z anrdaemon $
> ...
>
> In simpler words, the bin directory is symlinked from elsewhere.
> realpath -Le resolves correctly, but all other filesystem functions fail.
>
> I vaguely recall that there was some discussion on the matter, but search
> returns too many results, can't read them all.
> My question, basically: is this expected way of things?
The answer is yes it is expected and works the same on Linux.
> If so, I'd just workaround it. Sad but doable.
Don't be sad just do it. ;p
--
cyg Simple
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-11-02 14:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-01 22:50 Stumbled upon relative name resolution across symlinks Andrey Repin
2018-11-02 12:15 ` Ken Brown
2018-11-02 14:15 ` cyg Simple
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).