[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: [Newbie] Including a lua file from another lua file (problems with paths)
- From: Peter Cawley <lua@...>
- Date: Thu, 16 Jul 2009 02:13:22 +0100
On Thu, Jul 16, 2009 at 2:03 AM, Antoine
> A workaround would be to get the current's file path and concatenate the strings, but I haven't found a way to do that either.
Given the file "Lua\libs\dir.lua":
local path = debug.getinfo(1,"S").source:match("@(.*"..package.config:sub(1,1)..")")
Then the following:
Lua 5.1.4 Copyright (C) 1994-2008 Lua.org, PUC-Rio
> dofile [[Lua\libs\dir.lua]]
> require "Lua.libs.dir"