use separate index files
This commit is contained in:
parent
721db1cd90
commit
b4bf491b83
2 changed files with 5 additions and 3 deletions
|
@ -68,9 +68,10 @@ local function getAllFiles(program)
|
|||
local resultText = result.readAll()
|
||||
local resultTable = split(resultText, "\n")
|
||||
|
||||
local indexesFile = fs.open("bin/indexes.dat", "w")
|
||||
local indexesFile = fs.open(path .. program .. "/indexes.dat", "w")
|
||||
indexesFile.write(resultText)
|
||||
indexesFile.close()
|
||||
print("wrote indexes for " .. program)
|
||||
|
||||
local programsFile = fs.open(path .. "programs.dat", "a")
|
||||
programsFile.write(program)
|
||||
|
|
|
@ -59,7 +59,7 @@ local function getAllFiles(program)
|
|||
|
||||
local currentFiles = ""
|
||||
if fs.exists(path .. "indexes.dat") then
|
||||
local indexesFile = fs.open(path .. "indexes.dat", "r")
|
||||
local indexesFile = fs.open(path .. program .. "/indexes.dat", "r")
|
||||
currentFiles = indexesFile.readAll()
|
||||
indexesFile.close()
|
||||
end
|
||||
|
@ -80,9 +80,10 @@ local function getAllFiles(program)
|
|||
local resultText2 = result2.readAll()
|
||||
local resultTable2 = split(resultText2, "\n")
|
||||
|
||||
local newIndexesFile = fs.open(path .. "indexes.dat", "w")
|
||||
local newIndexesFile = fs.open(path .. program .. "/indexes.dat", "w")
|
||||
newIndexesFile.write(resultText)
|
||||
newIndexesFile.close()
|
||||
print("wrote new indexes for " .. program)
|
||||
|
||||
local finalResult = {}
|
||||
for key, value in ipairs(resultTable2) do
|
||||
|
|
Loading…
Reference in a new issue