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.

On Mon, Jan 4, 2021 at 7:30 AM Eliot Moss <m...@cs.umass.edu> wrote:
>
> On 1/4/2021 5:36 AM, Matt D. via Cygwin wrote:
>  > Did you try any of my test cases? This can't and doesn't work for the
>  > reasons I outlined in my previous message:
>  >
>  > $ cp -av folder_a/a folder_b/
>  > 'folder_a/a' -> 'folder_b/a'
>  > cp: cannot create symbolic link 'folder_b/a': No such file or directory
>  >
>  > $ cp -dv folder_a/a folder_b/
>  > 'folder_a/a' -> 'folder_b/a'
>  > cp: cannot create symbolic link 'folder_b/a': No such file or directory
>  >
>  > $ cp -Pv folder_a/a folder_b/
>  > 'folder_a/a' -> 'folder_b/a'
>  > cp: cannot create symbolic link 'folder_b/a': No such file or directory
>
> So did you mkdir folder_b first?  I don't think cp will create it for you.  I
> tried the commands above with folder_b not existing and got the behavior you
> indicated, but when I created folder_b first, all three cp commands worked.
> This overall behavior does not surprise me.
>
> On the other hand, if I have folder_b non-existing and do (e.g.)
>
> cp -rav folder_a folder_b
>
> then it _does_ create folder_b, and also copies the links.
>
> HTH - Eliot Moss
> --
> Problem reports:      https://cygwin.com/problems.html
> FAQ:                  https://cygwin.com/faq/
> Documentation:        https://cygwin.com/docs.html
> Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple
--
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

Reply via email to