Compare commits
No commits in common. "3266c66fc4e306fe888979a7cd44b190db456f6d" and "97e559f26f8c36027f1e742fc1196f4a394c29e6" have entirely different histories.
3266c66fc4
...
97e559f26f
@ -111,6 +111,4 @@ function pkgfs.add(fname,comp) -- string boolean -- -- Add a package as specifie
|
||||
f:close()
|
||||
end
|
||||
|
||||
fs.makeDirectory("/pkg")
|
||||
fs.mount("/pkg",pkgfs.component)
|
||||
return pkgfs
|
||||
|
@ -68,11 +68,7 @@ function fs.copy(from,to) -- string string -- boolean -- copies a file from *fro
|
||||
if not of or not df then
|
||||
return false
|
||||
end
|
||||
local tmp
|
||||
repeat
|
||||
tmp = of:read(2048)
|
||||
df:write(tmp or "")
|
||||
until not tmp
|
||||
df:write(of:read("*a"))
|
||||
df:close()
|
||||
of:close()
|
||||
return true
|
||||
|
@ -3,14 +3,12 @@ local serial = require "serialization"
|
||||
|
||||
local cfg = {["path"]="/boot/srv/frequest",["port"]=70}
|
||||
|
||||
local function loadConfig(cfgpath)
|
||||
local f=io.open(cfgpath or "/boot/cfg/fserv.cfg","rb")
|
||||
if f then
|
||||
local ncfg = serial.unserialize(f:read("*a"))
|
||||
f:close()
|
||||
for k,v in pairs(ncfg) do
|
||||
cfg[k] = v
|
||||
end
|
||||
f=io.open("/boot/cfg/fserv.cfg","rb")
|
||||
if f then
|
||||
local ncfg = serial.unserialize(f:read("*a"))
|
||||
f:close()
|
||||
for k,v in pairs(ncfg) do
|
||||
cfg[k] = v
|
||||
end
|
||||
end
|
||||
|
||||
@ -92,15 +90,6 @@ local function socketHandler(socket)
|
||||
end
|
||||
end
|
||||
|
||||
local function fileServer()
|
||||
while true do
|
||||
os.spawn(socketHandler(minitel.listen(70)),"fserv worker process")
|
||||
end
|
||||
while true do
|
||||
os.spawn(socketHandler(minitel.listen(70)),"fserv worker process")
|
||||
end
|
||||
|
||||
function start(cfgpath)
|
||||
loadConfig(cfgpath)
|
||||
return os.spawn(fileServer,"fserv")
|
||||
end
|
||||
|
||||
return {start=start}
|
||||
|
Loading…
Reference in New Issue
Block a user