- file link ?-linktype? linkname ?target?
On Windows NT/XP (NTFS filesystem) this can be used to create symbolic directory links (a little known feature of Windows) or hard file links (an almost as little known feature of Windows).
Tcl 8.4a5 now supports this command.
Purpose: to discuss the possibility of adding a new 'file link' command to Tcl. (see http://groups.google.com/groups?hl=en&lr=&ie=UTF8&oe=UTF8&th=887b11ac0fab6e29&rnum=4 )
older stuff...On MacOS, links are also supported (often called 'aliases'), but we need a patch like the one above to allow links to be created (i.e. the TclpObjLink function in tclMacFile.c needs completing).Windows 95/98/ME etc don't support links very much at all, but Windows NT/2000/XP using the NTFS filesystem (version 5, I think), do! See http://www.hlm.inc.ru/ for creating file-links, and http://www.rekenwonder.com/linkmagic.htm , http://windows.oreilly.com/news/win2kcommands_0401.html#linkd , http://www.codeproject.com/w2k/junctionpoints.asp, http://www.sysinternals.com/ntw2k/source/misc.shtml#junction for directory-links (the last two contain source code to create and query such links).DKF - You could handle the 95/98 case by simply reporting that the OS/FS doesn't support links (IIRC, supposedly not all Unix FSes support links either, though I've never encountered one which had problems that wasn't a mount of something derived from CP/M,DOS,etc...) If only shortcuts weren't the work of the devil incarnate after more than a few beers!Vince - Indeed, in Tcl 8.3 'file readlink' of course just returns 'invalid argument' under all versions of Windows. I've now uploaded a version of the patch to the sourceforge link above which contains an implementation for unix and windows.
RM The "file link" command can not create relative links:
LEG wants a -force option to forcibly create symbolic links with non-existing targets. This is e.g. needed when moving directory trees around, or when symbolic links are abused as information placeholders like it is done with the fnord webserver.[mjs] agrees, the requirement that the target exist for a symbolic link is an arbitrary (and bad) choice. Perhaps the option should be -nocomplain to be consistent with e.g. glob?
LVwikignome - 2010-04-28 08:44:41When you feel the topic is clear enough, the way to get the change considered is to request a TIP (Tcl Improvement Proposal) for the change. I'd recommend recruiting a champion from the TCT (Tcl Core Team) to help you through the process. Also, if you are uncertain about your ability to add the code for this change, you might recruit a Tcl C developer to look over your shoulder and help.Good luck - it sounds like a useful change.
Tcl 8.4a5 now supports this command.
Purpose: to discuss the possibility of adding a new 'file link' command to Tcl. (see http://groups.google.com/groups?hl=en&lr=&ie=UTF8&oe=UTF8&th=887b11ac0fab6e29&rnum=4 )
older stuff...On MacOS, links are also supported (often called 'aliases'), but we need a patch like the one above to allow links to be created (i.e. the TclpObjLink function in tclMacFile.c needs completing).Windows 95/98/ME etc don't support links very much at all, but Windows NT/2000/XP using the NTFS filesystem (version 5, I think), do! See http://www.hlm.inc.ru/ for creating file-links, and http://www.rekenwonder.com/linkmagic.htm , http://windows.oreilly.com/news/win2kcommands_0401.html#linkd , http://www.codeproject.com/w2k/junctionpoints.asp, http://www.sysinternals.com/ntw2k/source/misc.shtml#junction for directory-links (the last two contain source code to create and query such links).DKF - You could handle the 95/98 case by simply reporting that the OS/FS doesn't support links (IIRC, supposedly not all Unix FSes support links either, though I've never encountered one which had problems that wasn't a mount of something derived from CP/M,DOS,etc...) If only shortcuts weren't the work of the devil incarnate after more than a few beers!Vince - Indeed, in Tcl 8.3 'file readlink' of course just returns 'invalid argument' under all versions of Windows. I've now uploaded a version of the patch to the sourceforge link above which contains an implementation for unix and windows.
RM The "file link" command can not create relative links:
sh>> ln -s ./a ./bis different to
tclsh>> file link -symbolic ./b ./aThe complete path can be a problem on mounted filesystems.Vince adds that this has been addressed in Tcl 8.5.
LEG wants a -force option to forcibly create symbolic links with non-existing targets. This is e.g. needed when moving directory trees around, or when symbolic links are abused as information placeholders like it is done with the fnord webserver.[mjs] agrees, the requirement that the target exist for a symbolic link is an arbitrary (and bad) choice. Perhaps the option should be -nocomplain to be consistent with e.g. glob?
LVwikignome - 2010-04-28 08:44:41When you feel the topic is clear enough, the way to get the change considered is to request a TIP (Tcl Improvement Proposal) for the change. I'd recommend recruiting a champion from the TCT (Tcl Core Team) to help you through the process. Also, if you are uncertain about your ability to add the code for this change, you might recruit a Tcl C developer to look over your shoulder and help.Good luck - it sounds like a useful change.
