Path prefix //./ in Cygwin

Hans-Bernhard Bröker hbbroeker@gmail.com
Fri Jun 13 16:59:52 GMT 2025


Am 13.06.2025 um 07:38 schrieb Yuyi Wang via Cygwin:
>> If the CWD
>> is /proc (so something without a Windows CWD), it seems to fall back to
>> referring to '/a/b' again?!?
> Oh, no. That makes me nearly impossible to determine whether a path is absolute
> without getting the current PWD.

That distinction is impossible regardless of whether you know the PWD or 
not, largely because the concept of a working directory is itself 
fraught with quite a few complications.

Windows processes do not hold just a single current working directory 
(CWD).  Rather they maintain a separate current working folder (CWF) per 
drive letter, plus a single current working drive letter (CWL).   The 
equivalent of the CWD then is "CWF on CWL". The CWF of any drive, and 
the CWL, can be all changed independently.

That means path names on Windows know not just two (relative vs. 
absolute) but at least 4 types:

1) dir\file.ext   :: relative to the CWF on the CWL

2) \dir\file.ext :: relative to the root of CWL

3) d:dir\file.ext :: relative to the CWF of a given drive

4) d:\dir\file.ext :: absolute

Types 2) and 3) cannot qualify as relative, nor as absolute.  So this 
distinction cannot be mapped to Windows.

But we're not in a position to bluntly refuse such names, either.  So 
that's where we are.






More information about the Cygwin mailing list