3
I have a program in Lua. This is the file structure:
|Programa
|-Main.lua
|-config.lua
|--------functions
|-functions.lua
Through the functions.lua
, I want to give a require
in the config.lua
. Is there any way?
I’ve tried to:
require "../config"
require "..\\config"
It didn’t work, now the errors also show: no file '.. /luafunctions.lua'
– Gabriel Sales
And what appeared before?
– Maniero
Same message(in file), only without this directory.
– Gabriel Sales
try like this:
package.path = package.path .. ";../?.lua"
. Prints thepackage.path
and see if it’s being formed correctly.– Maniero
Returned: . /?. lua;/usr/local/share/lua/5.1/?. lua;/usr/local/share/lua/5.1/? /init.lua;/usr/local/lib/lua/5.1/?. lua;/usr/local/lib/lua/5.1/? /init.lua;/usr/share/lua/5.1/?. lua;/usr/share/lua/5.1/? /init.lua;.. /?. lua
– Gabriel Sales
Yeah, I have no idea, in my short experience I’ve never seen it happen.
– Maniero