delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/05/25/03:18:34

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
From: "Peter Fox" <peter DOT fox AT ifrsys DOT com>
To: <cygwin AT cygwin DOT com>
Subject: Serious brokeness of treating .lnk files as symlinks
Date: Fri, 25 May 2001 08:18:33 +0100
Message-ID: <000201c0e4ea$e90716d0$03250059@ifr.co.uk>
MIME-Version: 1.0
X-Priority: 3 (Normal)
X-MSMail-Priority: Normal
X-Mailer: Microsoft Outlook CWS, Build 9.0.2416 (9.0.2911.0)
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Importance: Normal

Like has already been mentioned, I have been hit by cygwin 1.3.2 breaking .lnk
files on copying. Even cp -a strips out all the extra properties.

A simple workaround for me has been to use copy at the command prompt to
rename the .lnk files .lk, then I can use the cygwin cp command to copy them
to a .lnk file without corruption.

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.

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.

For those that prefer the old behaviour generally, perhaps a CYGWIN
environment setting could automattically add the O_LINKISFILE flag to all
opens.

A further problem with handling .lnk files is that I use environment variables
in the path mapping, for example:

Desktop/Bash2.lnk -> %USERPROFILE%\bash.bat

cygwin doesn't understand this, and so complains the file doesn't exist. This
problem is exhibited after doing cp -a, in that it says it can't change the
modification times:

[504] cp -a Bash2.lk Bash2.lnk
cp: preserving times for Bash2.lnk: No such file or directory
[505] ls -l Bash2.l*
-rw-r--r--   1 Administ None         1416 May 25 08:15 Bash2.lk
lrwxrwxrwx   1 Administ None         1416 May 25 08:15 Bash2.lnk ->
%USERPROFILE%\bash.bat

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

Peter.


--
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