I have a function in a Lua script, that will take a file and and will work on it. Part of the work it does is to empty the file completely before working with it. The easiest way I know of doing this is to open the file with io.open
, and use the "w+"
parameter. The problem is that I always need to have the path to the file. I wanted to do this:
io.open(thefile, "w+"); -- here thefile is a file object
but of course, that doesn't work. I need a way to get a file path in Lua. Anyone got suggestions? Sorry if I posted this in the wrong forum :/