From c427477428c0c1d583f42c0e7784684b8f713a6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 28 Jan 2019 17:43:40 +0800 Subject: =?UTF-8?q?=E4=BD=BF=E7=94=A8=E6=96=B0=E7=9A=84=E8=BF=87=E6=BB=A4?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/utility.lua | 42 ------------------------------------------ 1 file changed, 42 deletions(-) (limited to 'server/src/utility.lua') diff --git a/server/src/utility.lua b/server/src/utility.lua index ee15bf38..b0d44a60 100644 --- a/server/src/utility.lua +++ b/server/src/utility.lua @@ -142,45 +142,3 @@ function io.save(file_path, content) return false, e end end - -function io.scan(path, ignore) - local result = {path} - local i = 0 - local absolute - if ignore then - absolute = {} - for _, name in ipairs(ignore) do - local absoluteName = fs.path(name):string():lower() - absolute[#absolute+1] = absoluteName - end - end - - local function isIgnored(path) - if not absolute then - return false - end - local target = path:string():lower() - for _, name in ipairs(absolute) do - if target == name then - return true - end - end - return false - end - - return function () - i = i + 1 - local current = result[i] - if not current then - return nil - end - if fs.is_directory(current) then - if not isIgnored(current) then - for path in current:list_directory() do - result[#result+1] = path - end - end - end - return current - end -end -- cgit v1.2.3