do you mean "search for a file" (which would be "set filename [tk_getOpenFile]"?
Or do you mean to search a given file for some text:
set fid [open <filename> r]
set str1 [read $fid]
set indx [string first "string to find" $str1]
Sorry, I make you confuse.
My question is how to search a file If I don't known which directory the file is belong to.
For example, if I try to looke for the file of " test.tk " , but I don't where they are,or I am not sure I have this file or not, then I go to the function of search, and type some reletive word, some thing like "ts.tk", then it will bring out a dialog box to tell me whether they have this file,if they have, it bring out some files which are close to the "ts.tk", and its corresponding position(which directory).
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.