Use os.remove() instead of os.execute("rm...") because it is less expensive

as it uses remove(3) C library function rather than fork/exec-ing a new process.
This commit is contained in:
Tigran Aivazian
2012-09-18 23:52:11 +01:00
parent 456136ef71
commit 4b9cf4eaf5

View File

@@ -217,7 +217,7 @@ function FileHistory:addAllCommands()
function(self)
file_entry = self.result[self.perpage*(self.page-1)+self.current]
local file_to_del = file_entry.dir .. "/" .. file_entry.name
os.execute("rm \""..DocToHistory(file_to_del).."\"")
os.remove(DocToHistory(file_to_del))
-- to avoid showing just deleted file
self:init()
self:setSearchResult(self.keywords)