Web lists-archives.com

Re: error in "cygpath" behavior

On 2018-08-31 16:34, Steven Penny wrote:
> On Fri, 31 Aug 2018 10:57:34, Corinna Vinschen wrote:
>> Long-standing behaviour.  ".." in Cygwin and ".." in Windows can totally
>> disagree.  The path is always convert to absolute at this point in favor
>> of correct output.  There's also the additional restriction (though
>> not in this case) that relative Windows paths must not be longer than
>> MAX_PATH (260) chars.
>> I'm certainly open to patches to the underlying cygwin_conv_path
>> function to change the Windows path to relative if possible.
> I am not understanding - it appears that "dot-dot" (..) is well defined by
>> The special filename dot-dot shall refer to the parent directory of its
>> predecessor directory. As a special case, in the root directory, dot-dot may
>> refer to the root directory itself.
> http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_13
> so it would appears that ".." would be an acceptable return value in any case.

See Eric Blake's response to other poster.
Proc FS entry /proc/self/cwd only links to the current working directory, and
may/does? not necessarily reflect the logical or physical path taken by cd to
get to the current directory: only the current shell tracks the logical or
physical path taken by cd to get to the current directory, and can interpret to
which directory .. refers.
If /proc/self/cwd tracked all processes' logical or physical paths taken by
chdir(2) to get to the current directory, that link might be used to resolve ..
unambiguously. Quoting Corinna: "PGA" ;^>

Take care. Thanks, Brian Inglis, Calgary, Alberta, Canada

This email may be disturbing to some readers as it contains
too much technical detail. Reader discretion is advised.

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