mirror of
https://git.shadowkat.net/izaya/OC-PsychOS2.git
synced 2024-11-16 09:31:35 -05:00
added the ability to unmount filesystems, removed fs mounting stuff on its own
This commit is contained in:
parent
a97e3c93ee
commit
a219b5603e
@ -97,12 +97,16 @@ function fs.rename(from,to) -- moves file *from* to *to*
|
|||||||
end
|
end
|
||||||
|
|
||||||
function fs.mount(path,proxy) -- mounts the filesystem *proxy* to the mount point *path* if it is a directory. BYO proxy.
|
function fs.mount(path,proxy) -- mounts the filesystem *proxy* to the mount point *path* if it is a directory. BYO proxy.
|
||||||
if fs.isDirectory(path) then
|
if fs.isDirectory(path) and not fsmounts[table.concat(fs.segments(path),"/")] then
|
||||||
fsmounts[table.concat(fs.segments(path),"/")] = proxy
|
fsmounts[table.concat(fs.segments(path),"/")] = proxy
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
return false, "path is not a directory"
|
return false, "path is not a directory"
|
||||||
end
|
end
|
||||||
|
function fs.umount(path)
|
||||||
|
local fsi,_ = fs.resolve(path)
|
||||||
|
fsmounts[fsi] = nil
|
||||||
|
end
|
||||||
|
|
||||||
function fs.mounts() -- returns a table containing the mount points of all mounted filesystems
|
function fs.mounts() -- returns a table containing the mount points of all mounted filesystems
|
||||||
local rt = {}
|
local rt = {}
|
||||||
@ -127,9 +131,5 @@ if computer.getBootAddress then
|
|||||||
fs.makeDirectory("boot")
|
fs.makeDirectory("boot")
|
||||||
fs.mount("boot",component.proxy(computer.getBootAddress()))
|
fs.mount("boot",component.proxy(computer.getBootAddress()))
|
||||||
end
|
end
|
||||||
for addr, _ in component.list("filesystem") do
|
|
||||||
fs.makeDirectory(addr:sub(1,3))
|
|
||||||
fs.mount(addr:sub(1,3),component.proxy(addr))
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user