What are circular symlinks in Unix-like systems used for? [closed]

这一生的挚爱 提交于 2019-12-13 15:02:32

问题


I was browsing a directory on a Linux machine, and when doing a detailed listing I noticed that a link is pointing to itself, for example:

somelink -> /path/to/directory/somelink

I am wondering what is the reason for doing such a thing?


回答1:


If the somelink is in /path/to/directory then this is an invalid symlink. If you try to access it, the filesystem will give you an error (probably something like too many levels of symbolic links*). It could have been a typo (or some other mistake) when it was created, or the symlink got moved somehow and ended up linking to itself.




回答2:


There's no good reason for a circular symlink. Most probably, it was created by accident.



来源:https://stackoverflow.com/questions/12680821/what-are-circular-symlinks-in-unix-like-systems-used-for

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!