[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Why the dot in package.path? ..and finding the source filename
- From: Petite Abeille <petite.abeille@...>
- Date: Wed, 8 Jul 2009 19:53:07 +0200
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.