P
P
Pavel Padozhnikov2015-07-23 14:14:39
Lua
Pavel Padozhnikov, 2015-07-23 14:14:39

What are the differences, what are their functions?

Looking at the programs, I noticed that in some files they use different functions, but in essence they are the same.
1. #!/home/test
2. dofile("/home/test")
3. os.execut("/home/test")
How are they different or did I mess something up?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vadim Misbakh-Soloviev, 2016-07-28
@mva

The first is not a function, but a shebang .
The second one loads the specified argument and executes it as a Lua script (can be in text form or in the form of bytecode compiled into a format compatible with the current interpreter).
The third is the equivalent of the system() function in C/C++: it executes an arbitrary program using the OS.
// only you made a typo and there execut e .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question