added fs utility functions
This commit is contained in:
parent
0fe7982c45
commit
bec97bb026
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user