more permission checks
This commit is contained in:
parent
0341a38a5b
commit
5ef48aeb64
@ -143,6 +143,7 @@ do
|
||||
return false
|
||||
end
|
||||
function fs.list(s)
|
||||
if not canread(s) then return false end
|
||||
s=s or ""
|
||||
local _,d,p = fs.resolve(s)
|
||||
if not d then
|
||||
@ -159,6 +160,7 @@ do
|
||||
return fT[d].makeDirectory(p or "/")
|
||||
end
|
||||
function fs.rm(s)
|
||||
if not canwrite(s) then return false end
|
||||
local _,d,p = fs.resolve(s)
|
||||
return fT[d].remove(p)
|
||||
end
|
||||
@ -234,6 +236,8 @@ function fs.cd(p)
|
||||
end
|
||||
end
|
||||
function fs.cp(s,d)
|
||||
if not fs.canread(s) then return false end
|
||||
if not fs.canwrite(d) then return false end
|
||||
local df = fs.open(d,"wb")
|
||||
local sf = fs.open(s,"rb")
|
||||
if df and sf then
|
||||
|
Loading…
Reference in New Issue
Block a user