This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: absolute native symlinks vs file explorer on windows 8.1


On Dec  4 22:26, Andras Nagy wrote:
> I'm experiencing the following symptom with the latest 64bit cygwin on
> windows 8.1: absolute native symlinks created with cygwin differ slightly
> from those created with mklink; cygwin's symlinks start with a "\\?\" .
> Because of this, file explorer (nee windows explorer) refuses to handle them
> properly, specifically, nothing happens when I double click on such a
> symlink. See exact repro below.
> 
> Cygwin exhibits the same behavior on windows 7, but windows 7's explorer
> handles such symlinks fine.

It also works fine on Windows Vista and Windows 8.  This is most
certainly a bug in Windows 8.1.

Cygwin uses the official OS function CreateSymbolicLinkW[1], which
handles the \\?\ prefix and thus long pathnames just fine.

CMD and the rest of the Windows 8.1 OS handles symlinks with long path
prefix correctly (try: cmd /c type v1.txt).  Only the ShellExecuteW
function seems to be broken now.

> Questions:
> - Why does the target of the native cygwin symlink start with "\\?\"  ?

Long path prefix[2].

> - Is there a way to make cygwin not add that prefix to native symlinks?

No, because it always worked so far.  We were not aware that Micorsoft
broke this functionality on Windows 8.1.

> - Alternatively, is there a way to make windows 8's file explorer behave
> like windows 7's explorer and tolerate such native symlinks?

This question you have to ask Microsoft.

We could workaround this in the next Cygwin version at least for short
paths < 260 chars by omitting the \\?\ prefix in this case.  It wouldn't
be the first OS bug we have to workaround, but it's kind of annoying
even so.

I'm going to discuss this bug in the Microsoft forums[3], maybe it will
get fixed in upcoming versions of Windows again.  I don't think we will
ever see a fix for 8.1, though.


Thanks,
Corinna

[1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa363866%28v=vs.85%29.aspx
[2] http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#maxpath
[3] http://social.msdn.microsoft.com/Forums/en-US/073d02a6-1181-4694-9e50-d6a05bd80663/shellexecutew-w-symlinks-broken-on-windows-81?forum=windowsgeneraldevelopmentissues

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Attachment: pgpnKXgXs7i_L.pgp
Description: PGP signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]