Compare commits
2 Commits
63cb1ceea4
...
77ceb65be6
Author | SHA1 | Date | |
---|---|---|---|
77ceb65be6 | |||
8e3ee7bcb2 |
@ -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 = "", ""
|
||||||
|
8
service/tape-iofs.lua
Normal file
8
service/tape-iofs.lua
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
local counter = 0
|
||||||
|
for addr in component.list("tape_drive") do
|
||||||
|
iofs.register("tape"..tonumber(counter),function()
|
||||||
|
local tape = component.proxy(addr)
|
||||||
|
return tape.read, tape.write, function() end, tape.seek
|
||||||
|
end)
|
||||||
|
counter = counter + 1
|
||||||
|
end
|
Loading…
Reference in New Issue
Block a user