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

• Subject: Re: Location of a package
• From: Tomas Guisasola Gorham <tomas@...>
• Date: Mon, 18 Feb 2008 16:31:16 -0300 (BRT)

	Hi Ignacio

> I'd like the module to be aware of where it was picked up from. That's
> because I want my module to be able to construct full pathnames pointing
> to files in subdirectories.
Why don't you use relative pathnames?

> If the answer is 'no', or 'no unless you patch Lua', then do you have
> any suggestions on how to deal with "resource files"?
> If my module is at c:\foo\bar\myModule.lua, I need to load files from
> c:\foo\bar\resource.txt or c:\foo\bar\blah.jpg, and the only path I'd
> like to configure is the one I set in package.path, so I can't hard-code
> the paths in myModule.lua
Why don't you put everything in a proper directory?:

c:\foo\bar\myModule\init.lua
\resource.txt
\blah.jpg

Regards,
Tomás