鏡像自
https://git.shadowkat.net/izaya/OC-PsychOS2.git
synced 2024-09-27 14:45:18 -04:00
added a filesyste manager program, for auto (un)mounting of filesystems
This commit is contained in:
父節點
e351683a88
當前提交
0aba709fb1
11
service/fsmanager.lua
Normal file
11
service/fsmanager.lua
Normal file
@ -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
|
載入中…
新增問題並參考
Block a user