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: `CYGWIN=winsymlinks:nativestrict`, `ln -s target link` fails if target doesn't exist


On 2016-04-29 13:34, Gene Pavlovsky wrote:
>>> POSIX says a symlink to a missing target is perfectly well-defined (you
>>> can't stat() through it, but you can readlink() it). But Windows native
>>> symlinks can't do that.  So the problems you are encountering all stem
>>> from the fact that you are trying to make Windows do something it can't.
>>
>> My initial reaction was that, too, but I tried mklink (CMD internal command)
>>
>>> mklink x y
>>
>> and it created the symlink in the empty directory just fine.
> 
> This is my point exactly. Windows dangling symlinks can be created as
> easily as in UNIX.
> At least this is the case on my Win7 x64.

No, it can't.

c:\>mklink a b
c:\>mkdir b
c:\>cd b
c:\b>cd ..
c:\>cd a
The directory name is invalid
c:\>rmdir b
c:\>echo hello > b
c:\>type a
hello

It only works for dangling links to files. Not good enough.

Cheers,
Peter

--
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


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