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]

Problem with Windows .lnk files treated as Symlinks


Hello,

since cygwin-1.3, Windows *.lnk files are treated as UNIX
symbolic links by default.

We rean into a problem where we wanted to use the "cp" 
command to copy a Windows *.lnk shortcut to a new place.
This worked alright with previous cygwin versions, but
with 1.3, the file referenced was copied instead of the
*.lnk file. 

One problem with this behavour is that additional attributes
of the *.lnk file (like parameters passed to the program
referenced, or an icon associated) are not copied in that 
case.

Looking at options of the CYGWIN environment variable as
well as options of the "cp" command, I found NO WAY of
copying the *.lnk file instead of the file referenced!
Even "cp -d", which is documented to preserve symbolic
links (and works like that on Linux) did not work.
Setting CYGWIN=nowinsymlinks only affects link creation,
but not link interpretation by "cp".

Taking into account that Windows Shortcuts are more than
UNIX symbolic links, and that thus a one-to-one mapping
is always problematic, I would suggest the following to
preserve a clean environment as well as backward
compatibility:

1.) Only *.lnk files created by Cygwin (with the special
    cygwin header), should be treated as symbolic links when 
    they are read. If the *.lnk file is not a "cygwin *.lnk"
    with its special header, it should be treated as a plain 
    file.
    If this is not observed, important information may be lost 
    (also think about programs like tar that cannot reproduce 
    an exact image of the original file system if *.lnk files 
    are not completely copied).

2.) If CYGWIN=nowinsymlinks is set, not only symbolic link
    creation but also symbolic link interpretation should
    be "classical", i.e. *.lnk files are treated as files.

Please keep me informed on your plans regarding this issue.

Thanks in advance,
Martin Oberhuber

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