diff --git a/Src/Hyperion-firmware-cct/lib/modules/CC-Tweaked/25_tty.kmod b/Src/Hyperion-firmware-cct/lib/modules/CC-Tweaked/25_tty.kmod index 8163ad2..0ded701 100644 --- a/Src/Hyperion-firmware-cct/lib/modules/CC-Tweaked/25_tty.kmod +++ b/Src/Hyperion-firmware-cct/lib/modules/CC-Tweaked/25_tty.kmod @@ -1,4 +1,5 @@ --:Minify:-- + local kernel = ... local apis = kernel.apis local native = apis.peripheral diff --git a/Src/Hyperion-kernel/lib/modules/hyperion/12_procfs.kmod b/Src/Hyperion-kernel/lib/modules/hyperion/12_procfs.kmod index 36ffcff..2688e75 100644 --- a/Src/Hyperion-kernel/lib/modules/hyperion/12_procfs.kmod +++ b/Src/Hyperion-kernel/lib/modules/hyperion/12_procfs.kmod @@ -132,6 +132,17 @@ function proxy:open(path, mode) if type(step[steps[#steps]]) == "function" then return step[steps[#steps]]("open", mode) end + elseif tostring(steps[1])=="self" then + local task=kernel.currentTask + local step = newtaskproxy(task) + for i=2, #steps-1 do + local dat = step[steps[i]] + if type(dat) ~= "table" then error("ENFILE") end + step=dat + end + if type(step[steps[#steps]]) == "function" then + return step[steps[#steps]]("open", mode) + end else for i=1, #steps-1 do local dat = step[steps[i]] @@ -166,6 +177,21 @@ function proxy:type(path, mode) if type(step[steps[#steps]]) == "table" then return "directory" end + elseif tostring(steps[1])=="self" then + local task=kernel.currentTask + if #steps==1 then return "directory" end + local step = newtaskproxy(task) + for i=2, #steps-1 do + local dat = step[steps[i]] + if type(dat) ~= "table" then error("ENFILE") end + step=dat + end + if type(step[steps[#steps]]) == "function" then + return step[steps[#steps]]("type", mode) + end + if type(step[steps[#steps]]) == "table" then + return "directory" + end else for i=1, #steps-1 do local dat = step[steps[i]] @@ -186,7 +212,7 @@ function proxy:list(path) local steps = kernel.vfs.splitPath(path) local step = data if #steps == 0 then - return table.merge(table.keys(data),table.keys(kernel.tasks)) + return table.merge(table.keys(data),table.keys(kernel.tasks),{"self"}) end if tonumber(steps[1]) then local task=kernel.tasks[steps[1]] @@ -200,6 +226,18 @@ function proxy:list(path) if type(step[steps[#steps]]) == "table" then return table.keys(step[steps[#steps]]) end + elseif tostring(steps[1])=="self" then + local task=kernel.currentTask + local step = newtaskproxy(task) + if #steps==1 then return table.keys(step) end + for i=2, #steps-1 do + local dat = step[steps[i]] + if type(dat) ~= "table" then error("ENOENT") end + step=dat + end + if type(step[steps[#steps]]) == "table" then + return table.keys(step[steps[#steps]]) + end else for i=1, #steps-1 do local dat = step[steps[i]]