never mind no reading files line by line in fs.read

This commit is contained in:
Izaya 2019-07-21 17:45:22 +10:00
parent 63cb1ceea4
commit 8e3ee7bcb2

View File

@ -29,19 +29,8 @@ for k,v in pairs({"makeDirectory","exists","isDirectory","list","lastModified","
end end
local function fread(self,length) local function fread(self,length)
length = length or "*l"
if length == "*a" then if length == "*a" then
length = math.huge length = math.huge
elseif length == "*l" then
local rstr, lstr = "", ""
while true do
lstr = fs.mounts[self.fs].read(self.fid,1)
if lstr == "\n" or not lstr then
break
end
rstr = rstr .. lstr
end
return rstr
end end
if type(length) == "number" then if type(length) == "number" then
local rstr, lstr = "", "" local rstr, lstr = "", ""