file = io.open("<filename>", "w")
file:write("Avar = "..var)
file:close()
At the moment I'm writing the varible directly into the file and running a dofile() to load it.
This method is ok for one or two varibles but soon the harddrive will fill up with more config files if there are too many varibles.
Is there a better way of saving config files?
For example only editing line 2 in the config file without effecting the other lines.
Var1 = true
Var2 = false -- Change this line only
Var3 = {1,2,3,4,5,6,7}
Or better yet just reading data instead of dofile()
true
false -- Change this line only
{1,2,3,4,5,6,7}
I will appreciate any help or advice you can give :D/>/>