forked from izaya/OC-PsychOS2
added programs to export and import filesystems over the network
This commit is contained in:
parent
f9c8000080
commit
2e10fb23b4
11
exec/exportfs.lua
Normal file
11
exec/exportfs.lua
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
local rpcs = require "rpc"
|
||||||
|
local ufs = require "unionfs"
|
||||||
|
|
||||||
|
local tA = {...}
|
||||||
|
local path = "/"..table.concat(fs.segments(tA[1]),"/")
|
||||||
|
|
||||||
|
local px = ufs.create(path)
|
||||||
|
for k,v in pairs(px) do
|
||||||
|
rpcs.register(path.."_"..k,v)
|
||||||
|
print(path.."_"..k)
|
||||||
|
end
|
9
exec/importfs.lua
Normal file
9
exec/importfs.lua
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
local rpc = require "rpc"
|
||||||
|
local tA = {...}
|
||||||
|
local host, rpath, lpath = tA[1], tA[2], tA[3]
|
||||||
|
|
||||||
|
local px = rpc.proxy(host,rpath.."_")
|
||||||
|
function px.getLabel()
|
||||||
|
return host..":"..rpath
|
||||||
|
end
|
||||||
|
fs.mount(lpath,px)
|
Loading…
Reference in New Issue
Block a user