Hi Håkon,
Håkon Hægland via Cygwin wrote:
I am on Windows 10 Home, 21H1. I am trying to understand what type of files
are generated by the "ln -s" command. According to this blog:
https://blogs.windows.com/windowsdeveloper/2016/12/02/symlinks-windows-10/
starting with Windows 10 Insiders build 14972, native symlinks can be
created without needing to elevate the console as administrator.
To enable this feature, go to "Windows Security" -> "For developers", and
turn on "Developer mode".
Further, according to:
https://cygwin.com/cygwin-ug-net/using-cygwinenv.html
https://cygwin.com/cygwin-ug-net/using.html#pathnames-symlink
Cygwin "ln -s" should create a native symlink if available, and otherwise
create a .lnk shortcut files with a special header and the DOS READONLY
attribute set. I tried this, first I switched off "Developer mode" and ran:
$ echo a > a.txt
$ CYGWIN=winsymlinks:native ln -s a.txt b.lnk # NOTE: should not create
native symlink since developer mode is not on..
$ ls -l
total 1.0K
-rw-r--r-- 1 hakon hakon 2 Jun 22 15:12 a.txt
lrwxrwxrwx 1 hakon hakon 5 Jun 22 15:17 b.lnk -> a.txt
$ readshortcut.exe -t b.lnk
readshortcut: Load failed on C:\cygwin64\home\hakon\test\symlink2\b.lnk
Why does readshortcut.exe fail to read the b.lnk file ? Are there some
other tools that can determine the type of the b.lnk file? Is it a native
symlink or a Windows shortcut file?
The file b.lnk is not a Windows shortcut file, which is why readshortcut is unable
to read it as such. I reproduced your report locally and tried to find some
method of displaying what specific type of file b.lnk is, but was unsuccessful.
Most tools just identify it as a symbolic link.
..mark
--
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