Tk Source Code

View Ticket
Login
Ticket UUID: 2780147
Title: Demo - dir browser tree fails
Type: Patch Version: None
Submitter: haertel Created on: 2009-04-24 05:51:32
Subsystem: 76. Widget Tour Assigned To: dkf
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2018-01-10 07:31:20
Resolution: Fixed Closed By: stu
    Closed on: 2018-01-10 07:31:20
Description:
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.
User Comments: stu added on 2018-01-10 07:31:20:
More than five days, even. Fixed in check-in [1bd221ce].

stu added on 2017-12-18 02:14:12:
This will be fixed in less than five days unless I'm told otherwise.

dkf added on 2013-11-03 13:13:30:

The only problem I ever encountered with using normalization of filenames was on old Solaris systems where an automounter was used: though the normalized filename was correct, it wouldn't get remounted if the automounter decided to unmount. (The mounting was hooked through symlink traversal, IIRC.) I've no idea at all if this still applies to OSes current in this millennium.


stwo added on 2012-07-30 12:12:17:
Is this still a problem?
Adding:
set f [file normalize $f]
Seems to have no ill effect on unix.

haertel added on 2009-04-24 12:51:32:

File Added - 324185: tree.tcl

Attachments: