Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Symlink of windows folder in bash cannot go into subdirectory #729

Closed
stevegaron opened this issue Aug 3, 2016 · 7 comments
Closed

Symlink of windows folder in bash cannot go into subdirectory #729

stevegaron opened this issue Aug 3, 2016 · 7 comments

Comments

@stevegaron
Copy link

I created a symlink in the bash subsystem to my git folder but I can go into the subdirectories of my git folder.

I'm expecting to be able to symlink between windows and bash without issues. Instead I'm locked into the symlink.

I have the following folder structure:

c:\Users\user\git\project1
              ...\project1\src
              ...\project2
              ...\project2\src
              ...\project3
              ...\project3\src

In bash, if I go to my home folder (cd ~) then create a symlink to my code (ln -s /mnt/c/Users/user/git) it creates the symlink fine in my home directory. Things get weird when I list files into the symlink:

steve@LENOVOX1:~$ ls ~/git
project1   project2   project3

steve@LENOVOX1:~$ ls ~/git/project1
project1   project2   project3

steve@LENOVOX1:~$ ls ~/git/project2
project1   project2   project3

I can also cd to infinite into the symlink:

steve@LENOVOX1:~$ cd git
steve@LENOVOX1:~/git$ cd git
steve@LENOVOX1:~/git/project1$ cd project1
steve@LENOVOX1:~/git/project1/project1$ cd project1
steve@LENOVOX1:~/git/project1/project1/project1$ cd project1

I'm running the following windows version:
August 2nd Aniversary build.

@onomatopellan
Copy link

Related to #650

create the symlink again without slash at the end and it should work.

@benhillis
Copy link
Member

@stevegaron Thank you for reporting this issue. I agree the current symlink behavior is not ideal for interop. One problem is that a symlink created in WSL might not mean anything to Windows. For example if you created a symlink to /proc/self Windows would have no way of traversing the symlink.

@2toginc
Copy link

2toginc commented Nov 3, 2016

Just a quick note the the (closed) referenced bug #833 does not fully address this issue.

The problem occurs when symlinking between the linux subsystem and the windows filesystem on /mnt/c, as described in the original post above. Using /mnt/c/path/to/whatever directly (without following a symlink) works fine. Symlinking within the linux subsystem (#833) now works fine.

So there is some issue with how symlinks are resolved when pointing to the windows filesystem on /mnt/c. I'm running build 14393.351, and I still have this issue.

Hope this helps, thanks for reading.

@ChristianLowe
Copy link

I want to leave my perspective here. I symlinked my Window's user directory to ~/winhome. You can imagine my displeasure when:

rm -rf ~/winhome/randomfolder

Turned out to reap some of my personal files in ~/winhome. (Before I realized the process was taking too long!) I feel that this is very dangerous default behavior.

@MBlagui
Copy link

MBlagui commented Feb 11, 2017

If you rm -rf any sub directory in sym linked directory it will be deleted. That's how it works on linux too. So it's not a special on windows 10.
So be carefull always with rm -rf and read the docs.

@sunilmut
Copy link
Member

sunilmut commented Mar 2, 2017

Adding @SvenGroot, to see if he can comment on the issue.

@SvenGroot
Copy link
Member

This issue has been fixed for the Creator's Update. You can update to the latest insider build to get the fix now, or wait for the release of the Creator's Update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants