How to get the file size and delete file in Lua?
The size is given by myFile:seek("end")
.
To delete the file, use os.remove(path)
. But close the file first.
Recently Lua File System support was added to Corona! You can get file size using
local lfs = require "lfs"
local size = lfs.attributes (path, "size")
You can have a read here http://keplerproject.github.com/luafilesystem/manual.html#reference
To delete the file use
os.remove(path)