Re: cygpath -w converts relative paths to absolute windows paths
- Date: Sat, 11 Feb 2017 16:28:09 -0500
- From: cyg Simple <cygsimple@xxxxxxxxx>
- Subject: Re: cygpath -w converts relative paths to absolute windows paths
On 2/8/2017 5:42 PM, Thomas Wolff wrote:
> Hi Andrey,
> Am 08.02.2017 um 11:54 schrieb Andrey Repin:
>> Greetings, Thomas Wolff!
>>> Am 07.02.2017 um 16:30 schrieb Andrey Repin:
>>>> Greetings, Roger Qiu!
>>>>> I've found that `cygpath --windows '../` will give back an absolute
>>>>> windows path.
>>>> ".." is a special path, that can't be safely converted.
>>> How is the special meaning of ".." so much different in Windows than in
>>> Cygwin/Linux/POSIX that it could not be mapped?
>>> Things like dir .., cd .., type ..\sub\file all work comparably.
>> Comparable? May be. Predictable?
> I don't know what __DIR__ is supposed to mean in PHP. Anyway, handling
It's simply a constant of the directory for the file in which __DIR__
appears. The constant has a namespace relative to the file.
> ".." is not predictable even within Linux/Cygwin, you could see
> something like:
>> ls dir1/file
>> cd dir2
>> ls ../dir1/file
> No such file or directory
> (if dir2 is a link), or can have surprising effects of cd vs. cd -P.
> I don't see how that should exclude ".." from being transformed to ".."
> by cygpath -w, even if the result may be somewhat unexpected in some
> border cases (which I haven't seen yet).
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple