apparently read was added to fs.open "r" mode in 2017
This commit is contained in:
@@ -77,6 +77,10 @@ function ramfs.open(node, fn, fl)
|
||||
local ctr = 0
|
||||
local lines
|
||||
return {
|
||||
read = function()
|
||||
ctr = ctr + 1
|
||||
return node.contents:sub(ctr, ctr)
|
||||
end,
|
||||
readLine = function()
|
||||
if not lines then
|
||||
lines = Util.split(node.contents)
|
||||
|
||||
@@ -74,6 +74,10 @@ function urlfs.open(node, fn, fl)
|
||||
|
||||
if fl == 'r' then
|
||||
return {
|
||||
read = function()
|
||||
ctr = ctr + 1
|
||||
return c:sub(ctr, ctr)
|
||||
end,
|
||||
readLine = function()
|
||||
if not lines then
|
||||
lines = Util.split(c)
|
||||
|
||||
Reference in New Issue
Block a user