我查看了 LuaFileSystem 文档,并没有真正理解如何创建一个临时文件并在其中写入。另外,我不确定在哪里可以找到我创建的临时文件。在 /tmp 中?
这是我的函数的样子:
do
function upload_file(web)
f = -- creates a temporary file
f:write(file.contents) -- writes the content of the file uploaded in the temp file
f:seek("set", 0) -- we go back at the beginning
s = f:read("*a") -- read it out
print (s) -- print it out
f:close() -- close it
end
end