added ps
This commit is contained in:
@@ -29,6 +29,7 @@ while true do
|
|||||||
if not ok then
|
if not ok then
|
||||||
print(err)
|
print(err)
|
||||||
end
|
end
|
||||||
|
printInline("> ")
|
||||||
stopInput=false
|
stopInput=false
|
||||||
str=""
|
str=""
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
for i,v in ipairs(syscall.getTasks()) do
|
||||||
|
local task = syscall.getTask(v)
|
||||||
|
print(task.pid,task.username,task.name,task.status)
|
||||||
|
end
|
||||||
@@ -80,7 +80,7 @@ end
|
|||||||
function table.hasKey(tabl, query)
|
function table.hasKey(tabl, query)
|
||||||
for i,v in pairs(tabl) do
|
for i,v in pairs(tabl) do
|
||||||
if i==query then
|
if i==query then
|
||||||
return true
|
return v
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
@@ -89,7 +89,7 @@ end
|
|||||||
function table.hasVal(tabl, query)
|
function table.hasVal(tabl, query)
|
||||||
for i,v in pairs(tabl) do
|
for i,v in pairs(tabl) do
|
||||||
if v==query then
|
if v==query then
|
||||||
return true
|
return i
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return false
|
return false
|
||||||
|
|||||||
@@ -406,7 +406,11 @@ function vfs.listdir(path)
|
|||||||
if disk:type(diskPath) ~= "directory" then error("ENOTDIR") end
|
if disk:type(diskPath) ~= "directory" then error("ENOTDIR") end
|
||||||
local meta = getFileMeta(path)
|
local meta = getFileMeta(path)
|
||||||
checkperms(meta, "r")
|
checkperms(meta, "r")
|
||||||
return disk:list(diskPath)
|
local list = disk:list(diskPath)
|
||||||
|
if table.indexOf(list,".meta")~=-1 then
|
||||||
|
table.remove(list,table.indexOf(list,".meta"))
|
||||||
|
end
|
||||||
|
return list
|
||||||
end
|
end
|
||||||
|
|
||||||
function vfs.mkdir(path)
|
function vfs.mkdir(path)
|
||||||
|
|||||||
@@ -180,7 +180,7 @@ end
|
|||||||
function sys.getTasks()
|
function sys.getTasks()
|
||||||
local ret={}
|
local ret={}
|
||||||
for i,v in pairs(tasks) do
|
for i,v in pairs(tasks) do
|
||||||
ret[i]=v.pid
|
ret[#ret+1]=v.pid
|
||||||
end
|
end
|
||||||
return ret
|
return ret
|
||||||
end
|
end
|
||||||
|
|||||||
0
Src/Hyperion-spm/bin/spm
Normal file
0
Src/Hyperion-spm/bin/spm
Normal file
Reference in New Issue
Block a user