Re: PROBE-FILE and Windows shortcuts



On Fri, 13 Oct 2006 22:18:15 +0100, David Golden <david.golden@xxxxxxxxxxxxx> wrote:

Timofei Shatrov wrote:

On Fri, 13 Oct 2006 14:11:32 -0400, vedm <ns@xxxxxx> tried to confuse
everyone with this message:


Under SBCL, ACL and LW on MS Windows PROBE-FILE returns nil for
shortcuts. Isn't that wrong?

Responding to the OP: it's certainly inconsistent. But hey, this
is Common Lisp, where the spec leaves lots of room for interpretation :-)

Under CLISP on Cugwin PROBE-FILE returns the full path of the file
which the shortcut is pointing to, so I was expecting that the other
implementations would do the same.

Really? That would make it possible to use ASDF on Windows as it was
intended, by creating shortcuts to .asd files in
ASDF:*central-registry*. Somebody should research that.


N.B. I might be out of date, I haven't had the misfortune to use
windows in quite a while now:

Windows shortcut .lnk files are more closely analogous to
KDE/GNOME .desktop files than symlinks, they're files interpreted (or
not) by a shell rather than interpreted by the VFS.

Yep. The baseline API consists of the IShellLink and IPersistFile
COM interfaces. I have no idea whether it's practical (or robust)
to try to process the .lnk files directly rather than go through
the COM interfaces, so let's assume COM for the sake of this discussion,
because at least that way is documented and supported. Then the issue
becomes writing COM client code, the difficulty of which depends on
how well a CL implementation integrates with C (and note that stdcall
support is a requirement).

Cygiwn, however, uses special augmented shortcut .lnk files to represent
emulated unix symlinks that you create from within cygwin. - I imagine
clisp is likely just using that support, and "alien to cygwin" (i.e.
native windows) unaugmented .lnk files created outside cygwin wouldn't
work or wouldn't work as well.

CLISP has code (in w32shell.c) that uses IShellLink and IPersistFile to
deal with .lnk files, but I haven't stepped through with a debugger to
verify that that code is actually executed. At the very least, other
implementors can get an idea (if not actual code) from CLISP.

The "native windows" lisps that aren't sitting on top of a unix
emulation layer that treats certain .lnk files specially (i.e. cygwin)
have no particular reason to support identical interpretation of them,
in fact it might complicate windows-native programming if they did
(since the main use for .lnk shortcuts in windows land is indeed for
the functionality .desktop files are for on KDE/GNOME - icons on the
desktop and in menus, and application programmers probably _don't_ want
them treated like symlinks.

I mostly agree, although I'm not sure to what degree programmers
feel that way. The OP apparently falls into the other camp.

Symlinks do actually have a more direct VFS-level analogue in
Windows NT land, but IIRC (and I probably don't!) they are limited
to pointing to directories for some reason)

Prior to Vista, NTFS supported hard links to files via CreateHardLink, or
you could set up a file-based reparse point. CreateHardLink is not supported
for directories. Directories are linked via reparse points (also known as
junctions), and my understanding is that you can't make a relative link as
is possible in Unix.

Vista apparently has some enhancements in this area that I haven't read
much about.

--
Jack Unrue
.



Relevant Pages

  • Re: desktop shortcuts/Outlook email links, dont work; XP says "Ca
    ... Yesterday, all day, the shortcuts worked fine. ... problem I had before I followed your instructions. ... For the Help and Support ... > Fix Windows XP Help - from Doug's site: ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: all exe files switched to .lnk file type??
    ... to start Windows at all. ... Shortcuts actually have the extension .lnk - but this is usually hidden by ... It could be that the associations for .lnk files have been messed up. ... Search on Google for "lnk association". ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Createing shortcuts using VB6
    ... I cannot find any info on what versions of Windows this ... use it in VBA as well as VB. ... the function it exports for creating lnk files ... It is designed to create shortcuts in either "\Start ...
    (microsoft.public.vb.general.discussion)
  • Re: PROBE-FILE and Windows shortcuts
    ... That would make it possible to use ASDF on Windows as it was ... by creating shortcuts to .asd files in ... Cygiwn, however, uses special augmented shortcut .lnk files to represent ... clisp is likely just using that support, and "alien to cygwin" (i.e. ...
    (comp.lang.lisp)
  • Lost Shortcuts
    ... start menu shortcuts were replaced with .lnk files that ... Windows does not know how to use. ... prompts me to select an appropriate program. ... get my shortcuts back? ...
    (microsoft.public.windowsxp.general)