diff --git a/lib/solvitdb.lua b/lib/solvitdb.lua index 9be6e3c..2e535ee 100644 --- a/lib/solvitdb.lua +++ b/lib/solvitdb.lua @@ -192,6 +192,18 @@ function solvitdb.get(path, name) return output end +function solvitdb.list(path) + checkArg(1, path, "string") + local handle, patLength = checkValidityAndOpen(path) + local pat = readPat(handle, patLength) + handle:close() + local list = {} + for index, _ in pairs(pat) do + table.insert(list, index) + end + return list +end + function solvitdb.remove() end