public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
From: Mark Geisert <mark@maxrnd.com>
To: cygwin@cygwin.com
Subject: Re: Type of symlink file and readshortcut
Date: Wed, 23 Jun 2021 15:24:58 -0700	[thread overview]
Message-ID: <462e4a4c-8648-c7b2-267a-db63851dba4b@maxrnd.com> (raw)
In-Reply-To: <CACxbc=Bimk7ky3uOTL5YwbMX5Qr2hRGWRfR+7ZwBwutRZPZeSg@mail.gmail.com>

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

  reply	other threads:[~2021-06-23 22:24 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22 13:47 Håkon Hægland
2021-06-23 22:24 ` Mark Geisert [this message]
2021-06-24  0:32   ` Doug Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=462e4a4c-8648-c7b2-267a-db63851dba4b@maxrnd.com \
    --to=mark@maxrnd.com \
    --cc=cygwin@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).