refact(files): create fileutils

This commit is contained in:
Thomas Lambert
2023-04-29 00:02:19 +02:00
parent cdffe4c626
commit fb7c5312a7
2 changed files with 39 additions and 29 deletions

View File

@@ -0,0 +1,17 @@
local M = {}
function M.file_exists(fname)
if fname == nil then
return false
end
local f = io.open(fname, "r")
if f ~= nil then
io.close(f)
return true
else
return false
end
end
return M