Subject: Re: Problem with tar version 1.29 (in Cygwin 3.6 64 bit) in extracting sym-link files
From: Eliot Moss <[email-masked]>
Cc: [email-masked]
Date: Fri, 2 Oct 2020 14:14:44 -0400
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>

On 10/2/2020 12:47 PM, vinay Hegde wrote:
> Hi Eliot Moss,
> Thank you very much for the quick response & the information.It really helped.
> I just set 'CYGWIN=winsymlinks:lnk' & I am now able to open sym-link
> file. Both 'CYGWIN=winsymlinks:lnk' & 'CYGWIN=winsymlinks' are working
> for me.
> But it creates a shortcut(not the regular file). Hope it won't impact
> my existing setup.
> 
> But both  'CYGWIN=winsymlinks:native' (which is default I believe) &
> 'CYGWIN=winsymlinks:nativestrict' are not working for me. Just to
> understand, In what OS environment/File System 'native' will work?
> 
> Regards
> Vinay Hegde

I run Windows 10 and that works for me.  Of course below, jcontrol should
be an actual file, while ControlPanel will be a symlink to it.  (That
particular name might behave oddly under Windows, because the Control
Panel is a built in thing!)

Not sure what else to say about the different forms.  The lnk form, as
I recall, builds a Cygwin-specific thing that Cygwin understands but
Windows tools will not - they'll just think its a small ordinary file
(its has within it, a few "magic" bytes then the name of the target
file).  You _want_ a short-cut, right?  ControlPanel -> jcontrol _is_
a link.

So I admit I am not fully understanding your post.

Also, on this list, the custom is to bottom-post (or intersperse) replies,
not to top-post.

Regards - EM

> On Fri, Oct 2, 2020 at 9:13 PM Eliot Moss <[email-masked]> wrote:
>>
>> On 10/2/2020 11:26 AM, vinay Hegde via Cygwin wrote:
>>> Hi Cygwin Team,
>>> In Cygwin 3.6, I am facing an issue while using tar.exe for extracting
>>> .tar.z file.
>>>
>>> Issue summary:
>>> When I use 'tar.exe' to extract the .tar.z file, it extracts all files
>>> including symlinks. But symlink file size will be 0KB & it throws
>>> error 'The file cannot be accessed by the system', if I try to open in
>>> any Windows editor like notepad or notepad++
>>>
>>> Below are the details:
>>> -   OS: Windows 2019
>>> -   Cygwin version installed: 3.6 (tar version: 1.29)
>>> -   Command used to extract the tar file is: tar -zxvf jre64.tar.Z
>>> -   'ls -l' on the extracted directory shows:
>>> lrwxrwxrwx  1 etbuild Domain Users      8 Jul 10  2017 ControlPanel -> jcontrol
>>> -rwxr-xr-x+ 1 etbuild Domain Users   7734 Mar 15  2017 java
>>> -rwxr-xr-x+ 1 etbuild Domain Users 128791 Mar 15  2017 javaws
>>> -rwxr-xr-x+ 1 etbuild Domain Users   6264 Mar 15  2017 jcontrol
>>>
>>> -     As you can see 'ControlPanel' is a symlink file with 0KB
>>> (8Bytes) size. This file, I cannot open in any Windows editor. It
>>> throws error like ''The file cannot be accessed by the system'
>>>
>>> -    However, I can open this file in vi editor or I can 'cat' this.
>>>
>>> -    Earlier, I was using Cygwin version 1.7 (tar version: 1.27) & in
>>> that, this issue was not there. Symlink file size was 1KB & I could
>>> open it with any Windows editor.
>>>
>>> Please suggest what needs to be done to fix this issue.
>>
>> Hi, Vinay - Cygwin can use, and create, a variety of forms of links.  Some of these are understood
>> by Windows tools, some not.  I suggest you read in the Cygwin documentation about symlinks and
>> decide what kind are best for you.  Then you'll need to set that up, delete the existing link, and
>> re-create it.  I personally run with CYGWIN=winsymlinks:native, but as we say in Internet land, YMMV.
>>
>> Regards - Eliot Moss
--
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