From: lostgallifreyan <los...@gm...> - 2009-05-28 23:25:00
|
John Labenski <jla...@gm...> wrote: (28/05/2009 23:56) >> PATH=string.gsub(arg[0],"^(.+[/\\]).+$","%1").."Bitmaps/" >> >> It works, but it's a clumsy method. At least it's portable, it accepts non-Windows path separators... > >This is a typical problem of finding where a program's external >resources are and is not unique to wxLua or Lua. The way you do it is >pretty a pretty standard way. You may want to create a shortcut to >your app and set the "Start In" path to the directory of the program >and its resources. > Ok, I guess not everything native to the OS is lovely. :) Shortcuts are binaries, they break at times (especially if triggered accidentally when they can't find the file they want...), I learned to avoid them except for simple stuff like drag-generated shortcuts made from existing files on demand. I'll stay with the method I worked out because that way I can separate the path and filename from the string, and I know I'll be wanting that done anyway for various things. Just need to use gfind instead of gsub to fetch both parts to variables. |