From: John L. <jla...@gm...> - 2012-08-23 03:47:29
|
On Sun, Aug 19, 2012 at 11:07 PM, Paul K <pau...@ya...> wrote: > Hi John, > >> Does wx.wxFileName.FileExists("SomethingInThatDir.txt") work, showing >> that SetCwd() worked? >> If so then, it'd be a problem with GetCwd(), but I cannot think of any >> reason why it wouldn't work off the top of my head... > > yes, it does seem like the problem is with GetCwd, and it should be > easy to reproduce: > >> wx.wxFileName.SetCwd([[D:\Lua\下载\下载\]]); print(wx.wxFileName.FileExists("foo.lua")); print(wx.wxGetCwd()); print(wx.wxFileName.SetCwd(wx.wxGetCwd())) > true > D:\Lua\??\?? > false > > As you can see, the file is there, but using the result of GetCwd to > set it as the current folder fails (returns "false" the second time). Hummm, I can't get to Windows machine right now, but I wonder if it's something to do with the conversion to a Lua ansi string rather than wxGetCwd() not returning the right value. Try this: s = wx.wxString([[D:\Lua\下载\下载\]]) print(s:GetData()) s2 = s:GetData() print(s2) Regards, John |