1
0
mirror of https://github.com/kepler155c/opus synced 2025-01-24 06:06:54 +00:00
This commit is contained in:
kepler155c@gmail.com 2017-06-02 15:42:40 -04:00
parent 3f3edefa7b
commit 890fad5099

View File

@ -37,7 +37,7 @@ end
function urlfs.open(node, fn, fl) function urlfs.open(node, fn, fl)
if fl ~= 'r' then if fl ~= 'r' and fl ~= 'rb' then
error('Unsupported mode') error('Unsupported mode')
end end
@ -58,6 +58,8 @@ function urlfs.open(node, fn, fl)
local ctr = 0 local ctr = 0
local lines local lines
if fl == 'r' then
return { return {
readLine = function() readLine = function()
if not lines then if not lines then
@ -73,6 +75,16 @@ function urlfs.open(node, fn, fl)
lines = nil lines = nil
end, end,
} }
end
return {
read = function()
ctr = ctr + 1
return c:sub(ctr, ctr)
end,
close = function()
ctr = 0
end,
}
end end
return urlfs return urlfs