Will luaL_loadfile also preload all dofile () in the lua file?

I preload the lua file using luaL_loadfile and then execute it a few timest (this is the server). I have several dofile() calls in a lua file.

Will luaL_loadfile also preload all dofile() into lua file?

+4
source share
2 answers

No, luaL_loadfile does not execute any code in the file, in particular, it does not call the built-in dofile() or require or any other function calls.

+3
source

Yes, but you shouldn't do that. Instead, upload the file once and execute it once in general (to run the code, define functions, etc.). Then just call certain functions several times.

+3
source

Source: https://habr.com/ru/post/1392334/


All Articles