delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/26/04:39:12

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
X-Envelope-Sender-Is: Andrej DOT Borsenkow AT mow DOT siemens DOT ru (at relayer david.siemens.de)
From: "Andrej Borsenkow" <Andrej DOT Borsenkow AT mow DOT siemens DOT ru>
To: "Peter Fox" <peter DOT fox AT ifrsys DOT com>, <cygwin AT cygwin DOT com>
Subject: RE: Serious brokeness of treating .lnk files as symlinks
Date: Sat, 26 May 2001 12:38:32 +0400
Message-ID: <000401c0e5bf$3eefa1a0$21c9ca95@mow.siemens.ru>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200
Importance: Normal
In-Reply-To: <000201c0e4ea$e90716d0$03250059@ifr.co.uk>

>
> A more serious problem is that if I use tar to archive .lnk
> files, they are
> not restored properly. They started as 'fat' links, and get restored as
> 'skinny' links. This new behaviour means that no cygwin tool will
> be able to
> handle backing up .lnk files properly.
>

I am afraid there is no solution without breaking compatibility. On Unix
symlink does not have any "contents" except the file name it points to. So,
tar saves just this filename. This allows tar archive to be moved to any
other compliant system. If you tar your files on Cygwin and restore them on
Unix you get identical filesystem structure including symlinks.

Saving additional information about symlink would mean extending tar format.
Such format is no more compatible with normal tar. It needs own magic number
to distinguish from normal tar. It cannot be restored on another system
anymore. It is a lot of work that is not limited to just additional open()
flag.

> My preferred solution would be to add a flag to the open() call, say
> O_LNKISFILE, which prevents the treating of a .lnk file as a symlink. This
> flag should be used by cp -d and tar to ensure correct behaviour
> when handling
> .lnk files.
>

cp case is different. I believe, cp should by default behave as you
descrived - if it is told to preserve symlink, it should preserve them -
exactly.

>
> Desktop/Bash2.lnk -> %USERPROFILE%\bash.bat
>
> cygwin doesn't understand this, and so complains the file doesn't
> exist

> This problem should be cured by the O_LNKISFILE flag as well.
>

Not that I understand. That problem has nothing to do with any flag. I did
not know that it is supported by Windows, but if it is, Cygwin should
support it as well by default. IIRC it was stressed that new symlinks are
compatible with Windows shortcuts.

-andrej


--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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