File: pddplink.tcl

package info (click to toggle)
pd-pddp 0.2.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 236 kB
  • sloc: ansic: 497; makefile: 348; sh: 30; xml: 28; tcl: 15
file content (16 lines) | stat: -rw-r--r-- 595 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

proc pddplink_open {filename dir} {
    if {[string first "://" $filename] > -1} {
        menu_openfile $filename
    } elseif {[file pathtype $filename] eq "absolute"} {
        menu_openfile $filename
    } elseif {[file exists [file join $dir $filename]]} {
        set fullpath [file normalize [file join $dir $filename]]
        set dir [file dirname $fullpath]
        set filename [file tail $fullpath]
        menu_doc_open $dir $filename
    } else {
        bell ;# beep on error to provide instant feedback
        pdtk_post "\[pddplink\] ERROR file not found: $filename\n"
    }
}