Updated 2005-11-28 01:00:23

if 0 {Richard Suchenwirth 2003-03-05 - In contrast with the more complex structure in desktop Windows shell links, symbolic links in Windows/CE are refreshingly simple: very brief text files with no trailing newline, consisting of three parts: a decimal number, a pound sign (#), and a string. I have observed other special formats, but when the string is enclosed in quotes, and the number matches the length of the quoted string, then the link is both human-readable and will be followed by CE's File Explorer.

So here's two routines to read and write such links:

 proc ce_writeLink {fn to} {
    set to \"[file native [file join [pwd]  $to]]\"
    set fp [open $fn w]
    puts -nonewline $fp [string length $to]#$to
    close $fp

 proc ce_readLink fn {
    set fp [open $fn]
    set data [read $fp]
    close $fp
    regexp (.+)#(.+) $data -> l s
    if {$l != [string length $s]} {
       error "unknown format: $data"
    file join [string range $s 1 end-1]

if 0 {

Arts and crafts of Tcl-Tk programming - Category Windows - Category File }