From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from m0.truegem.net (m0.truegem.net [69.55.228.47]) by sourceware.org (Postfix) with ESMTPS id B6091394AC03 for ; Wed, 23 Jun 2021 22:24:59 +0000 (GMT) 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 Received: (from daemon@localhost) by m0.truegem.net (8.12.11/8.12.11) id 15NMOw81062498 for ; Wed, 23 Jun 2021 15:24:58 -0700 (PDT) (envelope-from mark@maxrnd.com) Received: from 162-235-43-67.lightspeed.irvnca.sbcglobal.net(162.235.43.67), claiming to be "[192.168.1.100]" via SMTP by m0.truegem.net, id smtpdSn9jbq; Wed Jun 23 15:24:58 2021 Subject: Re: Type of symlink file and readshortcut To: cygwin@cygwin.com References: From: Mark Geisert 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: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Jun 2021 22:25:03 -0000 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