Menu

#282 Demo - dir browser tree fails

open
5
2009-04-24
2009-04-24
No

The directory browser tree fails on my windows system with the Tcl error:

-------- snip ----------
could not read "C:/~AVINSTL": no such file or directory
could not read "C:/~AVINSTL": no such file or directory
while executing
"file type $f"
(procedure "populateTree" line 8)
invoked from within
"populateTree $tree [$tree insert {} end -text $dir -values [list $dir directory]]"
(procedure "populateRoots" line 3)
invoked from within
"populateRoots $w.tree"
(file "D:/Tcl/demos/Tk8.6/tree.tcl" line 81)
invoked from within
"source D:/Tcl/demos/Tk8.6/tree.tcl"
("uplevel" body line 1)
invoked from within
"uplevel 1 [list source [file join $tk_demoDirectory $demo.tcl]]"
(procedure "invoke" line 12)
invoked from within
"invoke [.t index {@95,377}]"
(command bound to event)

------------- snap -----------

This bug can be fixed by normalizing the file paths in the proc populateTree. See attachment.

Discussion

  • haertel, ruediger

    fixed tcl error

     
  • Stuart Cassoff

    Stuart Cassoff - 2012-07-30

    Is this still a problem?
    Adding:
    set f [file normalize $f]
    Seems to have no ill effect on unix.

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.