Changed size and added some "close"s

This commit is contained in:
WS64
2014-08-13 08:08:18 +02:00
parent 19c7c14809
commit 09334dd7a6

View File

@@ -232,6 +232,8 @@ function Search:find()
line = f:read()
end
if f ~= nil then f:close() end
i = i - 1
if i > 0 then
self.count = i
@@ -247,7 +249,8 @@ function Search:onMenuHold(item)
if f == nil then
item.info = item.info .. "\nFile not found!"
else
item.info = item.info .. "\n" .. tostring(math.floor(100*f:seek("end")/1024/1024 + 0.5)/100) .. " MB"
item.info = item.info .. "\n" .. string.format("%4.1fM",lfs.attributes(item.path, "size")/1024/1024)
f:close()
end
UIManager:show(InfoMessage:new{text = item.info})
end