Tcl Source Code

View Ticket
Login
Ticket UUID: 459569
Title: source and open fail on shortcut files
Type: Bug Created on: 2001-09-07 15:51:38
Submitter: randalt Assigned to: hobbs
Subsystem: 37. File System Severity:
Priority: 5 Medium Last modified: 2004-11-18 00:49:16
Status: Closed Closed by: hobbs
Resolution: Wont Fix Closed on: 2004-11-17 17:49:16
Version: obsolete: 8.3
Description:
sourcing a link to a tcl script fails under NT4.0 and 
TCL8.3
the command

source file.lnk 

produces the message

invalid command name "L ..."

It appears that the shortcut descriptor file is being 
read rather than the file the shortcut points to.

The following commands also exhibit similar behavior

set filehandle [open file.lnk]
read file.lnk

This returns the contents of the shortcut descriptor 
not the file pointed to by the shortcut

file copy file.lnk newfile

The contents of newfile are the shortcut descriptor 
not the contents of the file pointed to by the 
shortcut.
User Comments:
vincentdarley added on 2001-09-08 00:06:35:
Logged In: YES 
user_id=32170

There is no support for links in Windows Tcl, because there 
seems to be no support for them in the Win32 APIs which Tcl 
uses (e.g. CopyFileW or CopyFileA).  Windows seems to 
expect an application to check every file accessed, whether 
it is a .lnk and then take some other action.  On Mac/Unix 
the OS does this for you.

The upshot is that to support this would involve lots and 
lots of changes and every single file access of any kind in 
Tcl would have to go through these extra hurdles...  Not 
ideal!  I don't know whether there are better approaches...

hobbs added on 2004-11-18 00:49:16:
Logged In: YES 
user_id=72656

As noted, Windows shortcut files are not real links, which
are supported since 8.4.