[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: "Include" lua-file
- From: steve donovan <steve.j.donovan@...>
- Date: Wed, 19 Mar 2014 08:29:22 +0200
On Wed, Mar 19, 2014 at 5:36 AM, <meino.cramer@gmx.de> 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 pl.app works like this (Penlight)