Cygwin CWD vs. Win32 CWD (was Re: [ANNOUNCEMENT] Updated: vim-7.3.003-1)
Andy Koppe
andy.koppe@gmail.com
Wed Aug 25 13:06:00 GMT 2010
On 25 August 2010 12:46, Corinna Vinschen wrote:
> I have created a patch which implements both, a /usr/lib/winsynccwd.o
> which you can link against, and a new environment setting CYGWIN=winsynccwd.
>
> To implement this as configurable as possible, I changed the new
> cygwin_internal (CW_SYNC_WINCWD) functionality to take an additional
> parameter:
>
> cygwin_internal (CW_SYNC_WINCWD, 0)
>
> Uncouple Win32 CWD from Cygwin CWD and immediately set
> Win32 CWD back to \\?\PIPE.
>
> cygwin_internal (CW_SYNC_WINCWD, 1)
>
> Uncouple Win32 CWD from Cygwin CWD, but immediately set the
> Win32 CWD exactly once to the Cygwin CWD.
>
> This is practically identical to the former simple
> cygwin_internal (CW_SYNC_WINCWD) implementation.
>
> cygwin_internal (CW_SYNC_WINCWD, 2)
>
> Couple Win32 CWD to Cygwin CWD and immediately set
> the Win32 CWD to the Cygwn CWD.
>
> Every chdir() call will keep the Win32 CWD in sync with the
> Cygwin CWD now, unless the Cygwin CWD is an invalid CWD for
> Win32, in which case it will set the Win32 CWD to \\?\PIPE.
>
> Usage of the new CYGWIN setting "winsynccwd":
>
> CYGWIN="nowinsynccwd" ==> cygwin_internal (CW_SYNC_WINCWD, 0)
> CYGWIN="winsynccwd" ==> cygwin_internal (CW_SYNC_WINCWD, 2)
> CYGWIN="winsynccwd:X" ==> cygwin_internal (CW_SYNC_WINCWD, X)
>
> Linking against /usr/lib/winsynccwd.o is equivalent to
>
> cygwin_internal (CW_SYNC_WINCWD, 2)
>
> Please see the patch below. Comments are highly welcome.
Given option 2, I think option 1 is unnecessary.
> Alternatively
> we just drop the entire jumble and keep the Win32 always in sync.
I vote for that, while keeping the patch somewhere safe in case the
inability to delete working directories causes actual problems.
Andy
More information about the Cygwin-developers
mailing list