delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/06/23/18:28:12

X-Recipient: archive-cygwin AT delorie DOT com
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B6091394AC03
Authentication-Results: sourceware.org;
dmarc=none (p=none dis=none) header.from=maxrnd.com
Authentication-Results: sourceware.org; spf=none smtp.mailfrom=maxrnd.com
Subject: Re: Type of symlink file and readshortcut
To: cygwin AT cygwin DOT com
References: <CACxbc=Bimk7ky3uOTL5YwbMX5Qr2hRGWRfR+7ZwBwutRZPZeSg AT mail DOT gmail DOT com>
From: Mark Geisert <mark AT maxrnd DOT com>
Message-ID: <462e4a4c-8648-c7b2-267a-db63851dba4b@maxrnd.com>
Date: Wed, 23 Jun 2021 15:24:58 -0700
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101
Firefox/52.0 SeaMonkey/2.49.4
MIME-Version: 1.0
In-Reply-To: <CACxbc=Bimk7ky3uOTL5YwbMX5Qr2hRGWRfR+7ZwBwutRZPZeSg@mail.gmail.com>
X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS,
KAM_LAZY_DOMAIN_SECURITY, NICE_REPLY_A, SPF_HELO_NONE, SPF_NONE,
TXREP autolearn=no autolearn_force=no version=3.4.2
X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on
server2.sourceware.org
X-BeenThere: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>
X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 15NMSBML023193

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019