#526 Incorrect truenames for Windows shortcut files

lisp error
clisp (525)
Timofei Shatrov

CLISP treats Windows shortcut files (*.lnk) like symlinks. Well, I wanted the DIRECTORY function to return the list of actual files (because recursively walking the directories resulted in loops). At first I thought that the :FULL keyword was what I wanted. But the true name that it returns for the shortcut lacks the ".lnk" extension, which leads to bad things.

For example:

[2]> (directory "C:\\Documents and Settings\\Timofei Shatrov\\Start Menu\\Progra
ms\\Sopcast\\*" :full t)
((#P"C:\\Documents and Settings\\Timofei Shatrov\\Start Menu\\Programs\\Sopcast\ \Uninstall"
#P"C:\\Program Files\\SopCast\\uninst.exe" (22 21 22 8 12 2007) 60179)
(#P"C:\\Documents and Settings\\Timofei Shatrov\\Start Menu\\Programs\\Sopcast\ \Website"
#P"C:\\Program Files\\SopCast\\SopCast.url" (22 21 22 8 12 2007) 99)
(#P"C:\\Documents and Settings\\Timofei Shatrov\\Start Menu\\Programs\\Sopcast\ \Uninstall Web Player"
#P"C:\\Program Files\\SopCast\\ActiveX\\uninstall.bat" (52 32 21 29 9 2006)
(#P"C:\\Documents and Settings\\Timofei Shatrov\\Start Menu\\Programs\\Sopcast\ \Install Web Player"
#P"C:\\Program Files\\SopCast\\ActiveX\\install.bat" (32 41 11 2 4 2006) 23)
(#P"C:\\Documents and Settings\\Timofei Shatrov\\Start Menu\\Programs\\Sopcast\ \SopCast"
#P"C:\\Program Files\\SopCast\\SopCast.exe" (48 32 12 30 4 2008) 1892352))

The truenames lack the .lnk extension.
Compare to the result of "dir" in Windows shell:

C:\Documents and Settings\Timofei Shatrov\Start Menu\Programs\SopCast>dir
Volume in drive C has no label.
Volume Serial Number is 4155-11F8

Directory of C:\DOCUME~1\TIMOFE~1\STARTM~1\Programs\SopCast

29.09.2007 12:23 <DIR> .
29.09.2007 12:23 <DIR> ..
08.12.2007 22:21 582 SopCast.lnk
29.09.2007 12:23 682 Install Web Player.lnk
29.09.2007 12:23 694 Uninstall Web Player.lnk
08.12.2007 22:21 582 Website.lnk
08.12.2007 22:21 577 Uninstall.lnk


  • Sam Steingold
    Sam Steingold

    • assigned_to: haible --> ampy
  • Sam Steingold
    Sam Steingold

    the code you are unhappy about was added on 2002-10-23 by Arseny Slobodjuck.
    Arseny, how is returning "foo" better than returning "foo.lnk"?

  • Hi. Sam, if you remember, the point was to make substitution for symbolic links under Windows. These links are used in build process in cygwin (to build in separate directory). Today we could use NTFS symbolic links. I'm not sure I can change the build scripts this way, but after the scripts are changed, I can make changes to DIRECTORY. I've spent much time for this functionality. Probably somebody used it for something else than clisp build?

  • Nope. I just recalled that this funny idea was inspired by cygwin that emulates symlinks with lnk even on NTFS. I'll check if it can be reconfigured for another behaviour.

  • thank you for your bug report.
    the bug has been fixed in the CVS tree.
    you can either wait for the next release (recommended)
    or check out the current CVS tree (see http://clisp.cons.org\)
    and build CLISP from the sources (be advised that between
    releases the CVS tree is very unstable and may not even build
    on your platform).

    • status: open --> closed-fixed