FS library updates
This commit is contained in:
parent
ed85e857ff
commit
eaa4eb7d86
@ -21,6 +21,14 @@ function fread(h,n)
|
||||
end
|
||||
return false
|
||||
end
|
||||
function freadall(f)
|
||||
local s=""
|
||||
repeat
|
||||
c=fread(f,2048)
|
||||
s=s..c
|
||||
until c==""
|
||||
return s
|
||||
end
|
||||
function fwrite(h,d)
|
||||
if hT[h] then
|
||||
return hT[h][1].write(hT[h][2],d)
|
||||
|
@ -17,14 +17,9 @@ function fmove(i,o)
|
||||
frm(i)
|
||||
end
|
||||
function fload(i)
|
||||
local f,s = fopen(i,"rb"),""
|
||||
local f = fopen(i,"rb")
|
||||
if f then
|
||||
local c=fread(f,math.huge)
|
||||
repeat
|
||||
s=s..c
|
||||
c=fread(f,math.huge)
|
||||
until c == nil
|
||||
return load(s)
|
||||
return load(freadall(f))
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user