Lua语言_获取文件字节数大小

function QMPlugin.Bytes(FileName)
  local size = 0
  pcall(
  function()
    local f = io.open(FileName, "r")
    if f == null then
        return null
    end
    size = f:seek("end")
    f:close()
  end)
  return size
end
Dim 字节数 = File.bytes("/sdcard/Mobile/a.txt")
TracePrint 字节数 //返回18个字节

 

赞 (0)