lua-users home
lua-l archive

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


On 01/14/2011 09:33 AM, Tang Daogang wrote:
What I want to know is to get  the current EXCUTED file's directory, not
the current process' directory.
In general, this is not possible. Because the file (chunk) being executed
maybe executed from memory (with the help of a loadstring) and loaded from a
database before that or simply generated on the fly, for example. AFAIK,
there is no facility to detect the method used to retrieve/generate the
chunk.

Are you sure you're solving the correct problem? Could you state your
purpose for finding out the directory of the file being executed?

Thanks.

Sincerely,
Nick