added fs utility functions

This commit is contained in:
Izaya 2017-08-01 14:36:38 +10:00
parent 0fe7982c45
commit bec97bb026

View File

@ -70,4 +70,24 @@ do
end end
return false return false
end end
function fs.list(s)
local _,d,p = fs.resolve(s)
return fT[d].list(p or "/")
end
function fs.mkdir(s)
local _,d,p = fs.resolve(s)
return fT[d].makeDirectory(p or "/")
end
function fs.rm(s)
local d,p = fs.resolve(s)
return fT[d].remove(p)
end
function fs.exists(s)
local d,p = fs.resolve(s)
return fT[d].exists(p)
end
function fs.isdir(s)
local d,p = fs.resolve(s)
return fT[d].isDirectory(p)
end
end end