lua-users home
lua-l archive

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



On Jul 8, 2009, at 3:11 PM, steve donovan wrote:

It would be IMHO rather more useful to have something meaning
'directory of current module', so you could deploy an application that
just used require() to tie itself together.  Currently this takes a
certain amount of hacking...

I would second that... it would indeed be rather handy for modules to seamlessly know where they where loaded from...

FWIW, here is the circus I'm going through to load resources relative to their code:

http://dev.alt.textdrive.com/browser/HTTP/Bundle.lua

If anyone has a more straightforward approach which works for both lua and luac, then I'm all ears :)

There was a thread a while back regarding this:

"Location of a package"
http://lua-users.org/lists/lua-l/2008-02/msg00678.html

Cheers,

PA.