Skip to content
Prev 13564 / 398502 Next

tkfilefind in tcltk on Windows2000

Hi,

The tkfilefind demo in the tcltk package doesn't seem to work for me in
Windows2000.

The demo script uses tkfilefind(".") which doesn't display the parent
directory so you can't browse around the whole drive.

Using tkfilefind() (which uses the default path getwd()) doesn't seem to
work for me at all.

I also tried tkfilefind("/") which worked fine but then using
[1] "//jm2.null.mc.img"
causes R to crash i.e. using "//jm2.null.mc.img" as a path to a file
doesn't seem to work.

I found a way round it using

path<-getwd()
if(.Platform$OS.type == "windows") {
path<-paste(substring(getwd(),1,2),Platform()$file.sep,sep="")
}

tkfilefind(path)

but this only allows you to access files on the drive of the working
directory.

I also found a problem selecting a file when the path has spaces. IIt
seems to return a vector of characters
[1] "C:/Program/Files" "/R/rw1031/FAQ"   

I was wondering if there was an easier way around these problems? I find
the tkfilefind function very useful when writing small GUI's that
read/write data from files.

Cheers,

Jonathan