lua-users home
lua-l archive

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


Hello,

I'm facing an issue I have no idea how to solve. In a subdir "data", a module "STACK_CATS" requires "Cat". STACK_CATS is itself required from a module "stack" in the top dir, using
   require "data.STACK_CATS"

Each require individually works, but the cascade does not:
lua: ./data/STACK_CATS.lua:3: module 'Cat' not found:
	no field package.preload['Cat']
	no file './Cat.lua'
	...
stack traceback:
	[C]: in function 'require'
	./data/STACK_CATS.lua:3: in main chunk
	[C]: in function 'require'
	stack.lua:31: in main chunk
	[C]: ?

I guess the current dir (I mean ./) is not updated to /data when passing from the module "stack" to the module "STACK_CATS": when copying the file stack.lua into the top dir, all works fine. Am I doing something wrong? Is there a way to force module search in the actual current dir?

Denis
________________________________

la vita e estrany

http://spir.wikidot.com/