Guest_imported
New member
- Jan 1, 1970
- 0
a file browser
here's the code
proc insert { dir } {
set lista [open "|ls $dir"]
fconfigure $lista -blocking false
fileevent $lista readable [list ok $lista]
vwait :ONE
close $lista
}
proc ok { f } {
set status [catch { gets $f line } result]
.esquerda.scrollbox.first insert end "$line"
}
the problem is that when i have a directory named like this :
\dir ec tory
the name apears correctly in the list and it is recognized as a directory but subdirectories or files inside "\dir ec tory" do not apear in the list box.
i've tried regsub to replace "\dir ec tory" with
"\dir\ ec\ tory
but it doesn't work
thanks for your time, bye
here's the code
proc insert { dir } {
set lista [open "|ls $dir"]
fconfigure $lista -blocking false
fileevent $lista readable [list ok $lista]
vwait :ONE
close $lista
}
proc ok { f } {
set status [catch { gets $f line } result]
.esquerda.scrollbox.first insert end "$line"
}
the problem is that when i have a directory named like this :
\dir ec tory
the name apears correctly in the list and it is recognized as a directory but subdirectories or files inside "\dir ec tory" do not apear in the list box.
i've tried regsub to replace "\dir ec tory" with
"\dir\ ec\ tory
but it doesn't work
thanks for your time, bye