lua-users home
lua-l archive

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


On Thu, Jul 16, 2009 at 2:03 AM, Antoine
Bruguier<Antoine.Bruguier@brion.com> wrote:
> 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)..")")
print(path)

Then the following:

Lua 5.1.4  Copyright (C) 1994-2008 Lua.org, PUC-Rio
> dofile [[Lua\libs\dir.lua]]
Lua\libs\
> require "Lua.libs.dir"
.\Lua\libs\