Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

issue with tk_getOpenFile 2

Status
Not open for further replies.

smugindividual

Programmer
Apr 14, 2003
104
US
A tester has found a situation were tk_getOpenFile raises and exception:

error getting working directory name: Error 0
while execution
"pwd"
(procedure "::gti::dialog::file2:Update" line 34)
invoked from within
"::gti::dialog::file2::Update .__tk_filedialog"
("after" script)





[pwd] is throwing Error 0 when the tester was trying to change the directory, and all following attempts to open the dialog resulted in the same error. The tester is unable to recreate the situation on demand but it has happened several times.

After some experimentation in the interactive mode, i found that [pwd] throws that exception when you are in a directory that has been deleted. However, when similar conditions occur when attempting to recreate the error with tk_getOpenFile, I get tcl msg widget saying that i dont not have permissions on that particular directory.

Is this a known problem, has anyone heard of this problem before, thoughts?
 
I've never run into this. Are you working on a UNIX platform? Can you see the same behavior on another OS?

Bob Rashkin
rrashkin@csc.com
 
Yes, sorry i am working on a UNIX platform. Sun Solaris

Unfortunately our application isnt written to run on windows. But when attempting to create a similar situation with the tk_getOpenFile dialog itself, i received all kinds of windows permission messages.
 
Well, it seems there's a genuine permissions conflict. In a way, that's what permissions are for. Would it solve your problem to just catch the error and branch to a handling routine?

Bob Rashkin
rrashkin@csc.com
 
Smug -

I quickly tested your scenario (I'm on Solaris)...
In a wish interactive session, I played around with both the tk_getOpenFile & tk_getSaveFile cmds. I created a junk directory, "cd" to that directory, invoked either of the two tk_get cmds, all is well. However, if I "rm -rf" the junk directory, then try to run either of the two tk_get cmds again, I get your error as well. Even if in the interactive session I "cd" to a valid directory, running the tk_get cmds returns an error. The tk_get cmds' "-initialdir" seems to not recognize the current working directory as it should --- hmmm, interesting!!

Another strange thing: when I run the following with a invalid, non-existing directory, it loads up to the valid portion of the directory..
>tk_getOpenFile -initialdir /validdir/validdir2/nonexistdir
irregardless of the pwd. Maybe you have to ...
> test if dir exist first and use the the -initialdir option of the tk_get cmd.

 
Thanks for the responses guys, I've got some good ideas how to deal with it.

Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top