mirror of
https://github.com/kepler155c/opus
synced 2025-10-30 15:13:01 +00:00
webrun
This commit is contained in:
@@ -37,7 +37,7 @@ end
|
||||
|
||||
function urlfs.open(node, fn, fl)
|
||||
|
||||
if fl ~= 'r' then
|
||||
if fl ~= 'r' and fl ~= 'rb' then
|
||||
error('Unsupported mode')
|
||||
end
|
||||
|
||||
@@ -58,6 +58,8 @@ function urlfs.open(node, fn, fl)
|
||||
|
||||
local ctr = 0
|
||||
local lines
|
||||
|
||||
if fl == 'r' then
|
||||
return {
|
||||
readLine = function()
|
||||
if not lines then
|
||||
@@ -73,6 +75,16 @@ function urlfs.open(node, fn, fl)
|
||||
lines = nil
|
||||
end,
|
||||
}
|
||||
end
|
||||
return {
|
||||
read = function()
|
||||
ctr = ctr + 1
|
||||
return c:sub(ctr, ctr)
|
||||
end,
|
||||
close = function()
|
||||
ctr = 0
|
||||
end,
|
||||
}
|
||||
end
|
||||
|
||||
return urlfs
|
||||
|
||||
Reference in New Issue
Block a user