I am wondering if there is a way of getting the path to the currently executing lua script file?
This is specifically not the current working directory, which could be
arg[0]:match('.*\\')
If it returns nil try changing the .\*\\\
with .*/
and arg[0]
with debug.getinfo(1).short_src
.
But I find this to be the best and shortest way to get the current directory.
You can of course append the file you are looking for with the ..
operator. It will look something like this:
arg[0]:match('.*\\')..'file.lua'