lua-users home
lua-l archive

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

On Wed, Mar 19, 2014 at 5:36 AM,  <> wrote:
> Is it possible to create an "include" for lua the clean way without
> modifying the lua installations settings like library-paths?

You can modify the global package.path yourself, if you know your own directory:

package.path = mydir..'/?.lua;'..package.path

Then require 'a4msdata.lua' works as you want.

So the problem is how to find the directory of your script...look at
arg[0] and extract its path.

require_here() in works like this (Penlight)