OC-PsychOS/wtape.lua

13 lines
234 B
Lua
Raw Normal View History

2017-07-30 19:12:10 +10:00
tArgs = {...}
component = require "component"
t=component.tape_drive
f=io.open(tArgs[1])
c=f:read("*a")
f:close()
t.seek(-math.huge)
fh="!"..string.format("%8d",c:len())
print("Header: "..fh)
t.write(fh)
t.write(c)
t.seek(-math.huge)