Native symbolic link behavior is broken and makes backups using Cygwin command line tools impossible
Eliot Moss
moss@cs.umass.edu
Mon Jan 4 16:32:40 GMT 2021
On 1/4/2021 10:27 AM, Matt D. via Cygwin wrote:
> I think there is a misunderstanding with how to set up your
> environment to reproduce my test cases. I did state in the subject
> "native symbolic links" but I can see that this can be misinterpreted
> and I should have clarified.
>
> I am using symbolic links native to Windows. My CYGWIN environment
> variable has been set to "winsymlinks:nativestrict" and my account has
> permission to make symbolic links. This is an issue specifically with
> Cygwin; I have no problems making links at the windows command line.
> Cygwin also does not have a problem making symbolic links-- if the
> target already exists. The issue is that I cannot create native
> symbolic links with Cygwin for targets that DON'T exist.
>
> The normal behavior for both Windows and Linux is to create the
> symbolic link whether the target exists or not. I don't know why
> Cygwin fails to do this only for native Windows symbolic links. It
> does not have a problem creating links to any target with the default
> Cygwin (non-Windows) symbolic links.
Ok, I see the behavior now that you are talking about. You can get it with ln
without any need for cp. With winsymlinks:nativestrict, if I do:
ln -s foo bar
and foo does not exist, it refuses to create the link. As you found, it also
refuses to cp it. However, I _was_ able to mv it.
Regards - Eliot
More information about the Cygwin
mailing list