lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


There is a LUA_API function named luaL_searchpath. This does all the work.
A trivial act to expose it as a Lua function.

Yeah, probably so. I'm still of the opinion that providing an absolute path to the location my package was loaded from is a better solution.

What if some other location on the search path contains the same file name as my package? What if the search path has been changed since my package has been loaded?

There are a lot of things out of package-implementors control once the end-user gets hold of it, especially as in many cases these users may not be entirely computer literate, let alone aware of the intricacies of Lua scripting :)

If I know where my package came from, I can address resources relative to that with some degree of certainty that the user can't screw up things too easily.

Love, Light and Peace,
- Peter Loveday