|
|
|
@ -157,16 +157,16 @@ local temp_file_prefix = string.format(".lite_temp_%08x", temp_uid) |
|
|
|
|
local temp_file_counter = 0 |
|
|
|
|
|
|
|
|
|
local function delete_temp_files() |
|
|
|
|
for _, filename in ipairs(system.list_dir(EXEDIR)) do |
|
|
|
|
for _, filename in ipairs(system.list_dir(TEMPDIR)) do |
|
|
|
|
if filename:find(temp_file_prefix, 1, true) == 1 then |
|
|
|
|
os.remove(EXEDIR .. PATHSEP .. filename) |
|
|
|
|
os.remove(TEMPDIR .. PATHSEP .. filename) |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
function core.temp_filename(ext) |
|
|
|
|
temp_file_counter = temp_file_counter + 1 |
|
|
|
|
return EXEDIR .. PATHSEP .. temp_file_prefix |
|
|
|
|
return TEMPDIR .. PATHSEP .. temp_file_prefix |
|
|
|
|
.. string.format("%06x", temp_file_counter) .. (ext or "") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|