lua-users home
lua-l archive

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


Viacheslav Usov <via.usov@gmail.com> 于2020年1月23日周四 上午1:48写道:
>
> On Tue, Jan 21, 2020 at 8:20 AM Hongyi Zhao <hongyi.zhao@gmail.com> wrote:
>
> > Is there any robust and convenient methods for me to obtain the lua script's (absolute/real) dirname and file name from within the script itself?
>
> Your question is not well defined. Lua can load and execute a string that resides entirely in memory without ever been stored in a file - is that a script? A Lua chunk can load and run another chunk, etc, some of which may or may not file based - what is "the script" in this case? Unless you indicate exactly what your "script" is, you are not going to get an unambiguous answer.

Sorry for my ambiguity in dicptions,  I only indicate the real file
based lua scripts.

Regards

>
> Cheers,
> V.



-- 
Hongsheng Zhao <hongyi.zhao@gmail.com>
Institute of Semiconductors, Chinese Academy of Sciences
GnuPG DSA: 0xD108493