mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Slightly shorter and more Lua-idiomatic way of reading lines.
This commit is contained in:
@@ -62,9 +62,7 @@ function FileInfo:getFolderContent()
|
||||
InfoMessage:show("Scanning folder...", 1)
|
||||
local tmp = assert(io.popen('du -a \"'..self.pathfile..'\"', "r"))
|
||||
local dirs, files, books, size, name, output, ftype, j = -1, 0, 0, 0
|
||||
while true do
|
||||
output = tmp:read("*line")
|
||||
if not output then break end
|
||||
for output in tmp:lines() do
|
||||
j = output:find("/")
|
||||
name = output:sub(j, -1)
|
||||
size = tonumber(output:sub(1, j-1)) -- in kB
|
||||
|
||||
Reference in New Issue
Block a user