getSize = function(Path) local f = io.open(tostring(Path), "rb") if f then local Byte = f:seek("end") f:close() local x1024 = 0.000977 local x1000 = 0.001 if Byte >= 1024 * 1024 * 1024 then Size = string.format("%.2fGB", (Byte * x1024 * x1024 * x1024)) elseif Byte >= 1024 * 1024 then Size = string.format("%.2fMB", (Byte * x1024 * x1024)) elseif Byte >= 1024 then Size = string.format("%.2fKB", (Byte * x1024)) else Size = (Byte) .. 'B' end return Size end return false end print(getSize(gg.getFile())) print(getSize('/storage/emulated/0/MT2/.FuHong/FuHong/算法/.文件/.设备内存测试工具.lua')) print(getSize('/storage/emulated/0/MT2/.FuHong/FuHong/.Tool.lua[加密耗时:84.23199999999997s].lua'))