[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: require relative to file which is calling
- From: Alex Bradbury <asb@...>
- Date: Fri, 21 Jan 2011 17:40:12 +0000
2011/1/21 Gustavo de Sá Carvalho Honorato <firstname.lastname@example.org>:
> how can I use require function passing the file path relative to the file
> that is calling the require function, as we do with #include in C?
Refer to the recent thread "How to get the directory of the current
As mentioned in that thread, debug.getinfo(1, "S").source:sub(2) will
give you the name of file being executed - you just need to split out
the dirname and then edit your package.path appropriately.