forked from izaya/OC-PsychOS2
importfs and exportfs improvements
This commit is contained in:
parent
6c2ef1580b
commit
cfe3e78d64
@ -1,6 +1,7 @@
|
|||||||
local computer = require "computer"
|
local computer = require "computer"
|
||||||
local minitel = require "minitel"
|
local minitel = require "minitel"
|
||||||
local event = require "event"
|
local event = require "event"
|
||||||
|
local ufs = require "unionfs"
|
||||||
local rpc = require "rpc"
|
local rpc = require "rpc"
|
||||||
local netutil = {}
|
local netutil = {}
|
||||||
|
|
||||||
@ -9,6 +10,7 @@ function netutil.importfs(host,rpath,lpath) -- import filesystem *rpath* from *h
|
|||||||
function px.getLabel()
|
function px.getLabel()
|
||||||
return host..":"..rpath
|
return host..":"..rpath
|
||||||
end
|
end
|
||||||
|
px.address = host..":"..rpath
|
||||||
return fs.mount(lpath,px)
|
return fs.mount(lpath,px)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -16,7 +18,7 @@ function netutil.exportfs(path) -- export the directory *path* over RPC
|
|||||||
local path = "/"..table.concat(fs.segments(path),"/")
|
local path = "/"..table.concat(fs.segments(path),"/")
|
||||||
local px = ufs.create(path)
|
local px = ufs.create(path)
|
||||||
for k,v in pairs(px) do
|
for k,v in pairs(px) do
|
||||||
rpcs.register(path.."_"..k,v)
|
rpc.register(path.."_"..k,v)
|
||||||
print(path.."_"..k)
|
print(path.."_"..k)
|
||||||
end
|
end
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user