Operating system for OpenComputers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
372B

  1. while true do
  2. local tE = {coroutine.yield()}
  3. if tE[1] == "component_added" and tE[3] == "filesystem" then
  4. local w, doesExist = pcall(fs.exists,"/"..tE[2]:sub(1,3))
  5. if not w or not doesExist then
  6. fs.mounts[tE[2]:sub(1,3)] = component.proxy(tE[2])
  7. end
  8. elseif tE[1] == "component_removed" and tE[3] == "filesystem" then
  9. fs.mounts[tE[2]:sub(1,3)] = nil
  10. end
  11. end