Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2003-11-13
07:18 • Ticket [714539ffff] Add .lnk support to file readlink on windows status st... artifact: 3c0ec894c9 user: dgp
07:11 • Ticket [714539ffff]: 5 changes artifact: e9dbcaf1a5 user: dkf
05:54 • Ticket [714539ffff]: 2 changes artifact: fc4ce5bb67 user: dgp
05:48 • Ticket [714539ffff]: 9 changes artifact: 5600254eee user: vincentdarley
05:24 • Ticket [714539ffff]: 1 change artifact: 8eea5ee047 user: dgp
2003-09-12
20:48 • Ticket [714539ffff]: 5 changes artifact: 8f11439536 user: vincentdarley
20:42 • Ticket [714539ffff]: 2 changes artifact: 5cf45da73c user: dkf
2003-04-07
03:05 • Ticket [714539ffff]: 4 changes artifact: 6bc3f7b87f user: patthoyts
2003-04-03
11:04 • New ticket [714539ffff]. artifact: 316861dc63 user: nobody

Add .lnk support to [file readlink] on windows

Open714539ffffffffffffffffffffffffffffffffffCreated 24 years agoUpdated 23 years ago
Descriptionplain2003-04-03 11:04:50
file readlink is documented as:
"Returns the value of the symbolic link given by name 
(i.e. the name of the file it points to). If name isn't a 
symbolic link or its value cannot be read, then an error 
is returned. On systems that don't support symbolic 
links this option is undefined."

It is no question that symbolic links are not *fully* 
supported on Windows, but .lnk files go part of the way 
(though even cmd.exe doesn't honor them). However, 
Cygwin uses .lnk files to model symbolic links quite 
successfully.

I propose that instead of raising an error when called 
with a .lnk file, [file readlink] should return the path 
pointed to in the .lnk file, using IShellLink routines.

Resolution of pathnames in which parts are really .lnk 
files may be more difficult.

[email protected]
patthoytsplain2003-04-07 03:05:42
Logged In: YES 
user_id=202636

Note that the NTFS file system does support links to both
files and directories. How this be detected I don't know 
but as an example, my   %HOME%\src directory has a link to
my tcl installation directory and it looks like this using
the dir command:
12/03/2003  15:51       <JUNCTION>     tcl
01/04/2003  01:04       <DIR>          winsend

where 'tcl' is a link to 'c:\opt\tcl\src'
dkf Ticket [714539ffff]: 2 changes [History diff]2003-09-12 20:42:50
vincentdarleyplain2003-09-12 20:48:30
Logged In: YES 
user_id=32170

Tcl supports NTFS's 'junction points' already (these are
symbolic directory links -- see TIP#99).  NTFS also supports
hard file links which Tcl handles.

As for supporting soft file links implemented with '.lnk',
that is an admirable goal that someone could set about
implementing.
dgp Ticket [714539ffff]: 1 change [History diff]2003-11-13 05:24:00
vincentdarleyplain2003-11-13 05:48:12
Logged In: YES 
user_id=32170

Changed to feature request, and clarified the summary. I
have no intention of implementing this, but would support
someone else's efforts in that direction.
dgp Ticket [714539ffff]: 2 changes [History diff]2003-11-13 05:54:41
dkfplain2003-11-13 07:11:19
Logged In: YES 
user_id=79902

Ooer!  Windows guts!  Please hand this on to someone who
knows that platform's inner API sanctum, since I don't...
dgp Ticket [714539ffff]: 1 change [History diff]2003-11-13 07:18:35
Log in (anonymous is fine) to add a comment.