瀏覽代碼

added a filesyste manager program, for auto (un)mounting of filesystems

pull/1/head
XeonSquared 4 年之前
父節點
當前提交
0aba709fb1
共有 1 個文件被更改,包括 11 次插入0 次删除
  1. +11
    -0
      service/fsmanager.lua

+ 11
- 0
service/fsmanager.lua 查看文件

@@ -0,0 +1,11 @@
while true do
local tE = {coroutine.yield()}
if tE[1] == "component_added" and tE[3] == "filesystem" then
local w, doesExist = pcall(fs.exists,"/"..tE[2]:sub(1,3))
if not w or not doesExist then
fs.mounts[tE[2]:sub(1,3)] = component.proxy(tE[2])
end
elseif tE[1] == "component_removed" and tE[3] == "filesystem" then
fs.mounts[tE[2]:sub(1,3)] = nil
end
end

Loading…
取消
儲存