mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-19 12:17:17 -04:00
fixes for bind remove and cleanup
This commit is contained in:
parent
7200990048
commit
5107afb176
@ -62,5 +62,5 @@ os.setenv("TMP", "/tmp") -- Deprecated
|
||||
os.setenv("TMPDIR", "/tmp")
|
||||
|
||||
if computer.tmpAddress() then
|
||||
fs.mount(computer.tmpAddress(), os.getenv("TMPDIR") or "/tmp")
|
||||
fs.mount(computer.tmpAddress(), "/tmp")
|
||||
end
|
||||
|
@ -8,7 +8,7 @@ local core_stderr = buffer.new("w", setmetatable(
|
||||
write = function(_, str)
|
||||
return tty_stream:write("\27[31m"..str.."\27[37m")
|
||||
end
|
||||
}, {__index=tty_stream}))
|
||||
}, {__index=tty_stream}))
|
||||
|
||||
core_stdout:setvbuf("no")
|
||||
core_stderr:setvbuf("no")
|
||||
|
@ -1,11 +1,12 @@
|
||||
local event = require("event")
|
||||
local fs = require("filesystem")
|
||||
local shell = require("shell")
|
||||
local tmp = require("computer").tmpAddress()
|
||||
|
||||
local pendingAutoruns = {}
|
||||
|
||||
local function onComponentAdded(_, address, componentType)
|
||||
if componentType == "filesystem" and require("computer").tmpAddress() ~= address then
|
||||
if componentType == "filesystem" and tmp ~= address then
|
||||
local proxy = fs.proxy(address)
|
||||
if proxy then
|
||||
local name = address:sub(1, 3)
|
||||
|
@ -184,6 +184,7 @@ local function bind_proxy(path)
|
||||
end
|
||||
end
|
||||
local bind = {
|
||||
type = "filesystem_bind",
|
||||
address = real,
|
||||
isReadOnly = real_fs.isReadOnly,
|
||||
list = wrap_relative(real_fs.list),
|
||||
@ -192,6 +193,7 @@ local function bind_proxy(path)
|
||||
lastModified = wrap_relative(real_fs.lastModified),
|
||||
exists = wrap_relative(real_fs.exists),
|
||||
open = wrap_relative(real_fs.open),
|
||||
remove = wrap_relative(real_fs.remove),
|
||||
read = real_fs.read,
|
||||
write = real_fs.write,
|
||||
close = real_fs.close,
|
||||
|
@ -61,10 +61,15 @@ local targets = {}
|
||||
|
||||
-- tmpfs is not a candidate unless it is specified
|
||||
|
||||
local comps = require("component").list("filesystem")
|
||||
local devices = {}
|
||||
|
||||
-- not all mounts are components, only use components
|
||||
for dev, path in fs.mounts() do
|
||||
devices[dev] = devices[dev] and #devices[dev] < #path and devices[dev] or path
|
||||
if comps[dev.address] then
|
||||
local known = devices[dev]
|
||||
devices[dev] = known and #known < #path and known or path
|
||||
end
|
||||
end
|
||||
|
||||
local dev_dev = fs.get("/dev")
|
||||
|
Loading…
x
Reference in New Issue
Block a user