Don't write to temporary file on the flash device.

Instead of writing to (and reading from) the temporary file
"history/.history.txt" create a pipe to the appropriate process
and read from it.
This commit is contained in:
Tigran Aivazian
2012-09-24 09:04:57 +01:00
parent 52d4b09d6b
commit d338eff00d

View File

@@ -51,9 +51,8 @@ end
function FileHistory:readDir(order_criteria)
self.history_files = {}
self.files = {}
local listfile = self.path.."/.history.txt"
os.execute("ls "..order_criteria.."-1 "..self.path.." > "..listfile)
for f in io.lines(listfile) do
local p = io.popen("ls "..order_criteria.."-1 "..self.path)
for f in p:lines() do
-- insert history files
file_entry = {dir=self.path, name=f}
table.insert(self.history_files, file_entry)
@@ -61,6 +60,7 @@ function FileHistory:readDir(order_criteria)
file_entry = {dir=HistoryToPath(f), name=HistoryToName(f)}
table.insert(self.files, file_entry)
end
p:close()
end
function FileHistory:setSearchResult(keywords)