||04-29-2011 10:04 AM
File Handling Help
I have a couple of questions on file handling. The first is can anyone tell me why I am getting this error:
20: bad argument #1 to 'read' (invalid format)
for this code:
Collisionmap = io.open(file,"r");
if p.lr == "left" then
for i=1,28 do
collisiontable[#collisiontable].type = Collisionmap:read("*n");
This was working before but now I do not know why it crashes ("*n") is a proper format.
Second question, i am trying to create a temporary file and this works to an extent:
tmpcol = assert(io.tmpfile())
If you are wondering why assert is there it is because without assert it prints out the error:
if you put it there:
This happens with the adk, if you do not run as administrator ( vista/windows 7).
Does anyone know of a better way to create a temporary file?