This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Serious brokeness of treating .lnk files as symlinks


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]