0

I must preface this question with the following information: This problem only occurs when my application is wrapped with TclApp

I understand that when wrapping a Tcl program, one must lappend to the auto_path the location of the directory the program needs to look for files if it is not already wrapped in the internal file system. That is what I have done, but my code only works for tk_getOpenFile, not tk_getSaveFile. Rather than opening the save dialogue in the specified directory, it opens it in My Documents.

Here is essentially what I'm doing:

set root [file dirname [info script]];
if {$iswrapped} {
    lappend auto_path "$root/../../../../myFolder";
    set target_dir "$root/../../../../myFolder";
}

set filename [tk_getSaveFile -initialdir $target_dir -title "Save As"];

I've made sure this isn't an issue with Windows (where it saves the dialogue open location after saving/opening the first time there with the program.) When I run my program for the first time on a brand new system, tk_getSaveFile opens in My Documents, whereas tk_getOpenFile opens in the correct folder, 'myFolder.'

Any ideas?

Edit:

I now noticed a very strange issue occuring as well and I suspect it might be related. Now, whenever I save a file in any child directory under C:\, I can only see the file through my program's open and save dialogues. If I navigate to the same location in the Windows Explorer, there files are not only not visible, but not there at all! What is going on here?

Edit:

My program had to be run with administrator privileges - that's why I got that really strange error (the second one.)

Vee
  • 729
  • 10
  • 27
  • 1
    Is 'myFolder' inside your virtual filesystem or outside? The windows file dialogs do not know about the Tcl VFS, so cannot open things from the inside. – schlenk Jul 29 '14 at 17:18
  • It's outside, that's why I had to lappend to auto_path so my program can look outside of the VFS. – Vee Jul 29 '14 at 17:26
  • Instead of lappending `"$root/../../../../myFolder"`, how about passing it through `file normalize` first? – This isn't my real name Aug 14 '14 at 00:38

0 Answers0