mirror of
https://github.com/20kdc/OC-KittenOS.git
synced 2024-11-08 11:38:07 +11:00
25 lines
459 B
Lua
25 lines
459 B
Lua
|
os.execute("tar -cf code.tar code")
|
||
|
os.execute("cat insthead.lua > inst.lua")
|
||
|
local f = io.open("inst.lua", "ab")
|
||
|
|
||
|
local df = io.open("code.tar", "rb")
|
||
|
local sc = 0
|
||
|
while true do
|
||
|
local d = df:read(512)
|
||
|
if not d then break end
|
||
|
sc = sc + 1
|
||
|
end
|
||
|
df:close()
|
||
|
local df = io.open("code.tar", "rb")
|
||
|
f:write("sC = " .. sc .. "\n")
|
||
|
while true do
|
||
|
local d = df:read(512)
|
||
|
if d then
|
||
|
f:write(string.format("sector(%q)", d))
|
||
|
else
|
||
|
break
|
||
|
end
|
||
|
end
|
||
|
df:close()
|
||
|
f:close()
|