fixed a few crashes resulting from the fs library
This commit is contained in:
parent
57e9a106c2
commit
e341ada43e
@ -42,6 +42,7 @@ do
|
|||||||
function fs.open(p,m)
|
function fs.open(p,m)
|
||||||
local _,d,p = fs.resolve(p)
|
local _,d,p = fs.resolve(p)
|
||||||
local d = fT[d]
|
local d = fT[d]
|
||||||
|
if d then
|
||||||
local f,C=d.open(p,m),hT._c
|
local f,C=d.open(p,m),hT._c
|
||||||
if f then
|
if f then
|
||||||
hT._c = C + 1
|
hT._c = C + 1
|
||||||
@ -50,6 +51,7 @@ do
|
|||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
end
|
||||||
function fs.close(h)
|
function fs.close(h)
|
||||||
if hT[h] then
|
if hT[h] then
|
||||||
hT[h][1].close(hT[h][2])
|
hT[h][1].close(hT[h][2])
|
||||||
@ -99,8 +101,10 @@ do
|
|||||||
end
|
end
|
||||||
function fs.exists(s)
|
function fs.exists(s)
|
||||||
local _,d,p = fs.resolve(s)
|
local _,d,p = fs.resolve(s)
|
||||||
|
if d then
|
||||||
return fT[d].exists(p)
|
return fT[d].exists(p)
|
||||||
end
|
end
|
||||||
|
end
|
||||||
function fs.isdir(s)
|
function fs.isdir(s)
|
||||||
local _,d,p = fs.resolve(s)
|
local _,d,p = fs.resolve(s)
|
||||||
return fT[d].isDirectory(p)
|
return fT[d].isDirectory(p)
|
||||||
|
Loading…
Reference in New Issue
Block a user