Type of symlink file and readshortcut
Tue Jun 22 13:47:00 GMT 2021
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:
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:
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
-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?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 34786 bytes
Desc: not available
More information about the Cygwin