user1108983
user1108983

Reputation:

How do I run a .lua file?

I need to run a .lua file with another .lua file. Here is my code:

Program = io.read()
dofile(program)

I type the name of the file that I want to run correctly, but for some reason my compiler says that the file I typed does not exist. (Which it does)

Upvotes: 2

Views: 2268

Answers (2)

daurnimator
daurnimator

Reputation: 4311

Lua is case sensitive; Program is not program Otherwise the code should work.

Upvotes: 12

Pedro Nascimento
Pedro Nascimento

Reputation: 13886

Try putting the full path instead of the relative path. i.e. /home/nick/script.lua

Upvotes: 3

Related Questions