Files
module-fastwebcore/target/fastweb/process.lua
2026-03-31 16:00:38 +08:00

75 lines
1.6 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- process.lua
local process = {}
process.module = fw_process
--[[
FUNCTION 创建进程
PARAMS
filepath : 脚本文件路径
working_directory : 工作目录
args : 参数表
wait_close : 是否等待关闭
show_window : 是否显示窗口
RETURN
`number` : 进程ID (PID)0表示失败
]]
function process.create(filepath, working_directory, args, wait_close, show_window)
return process.module.create(filepath, working_directory, args, wait_close, show_window)
end
--[[
FUNCTION 关闭进程
PARAM
pid : 进程ID (PID)
RETURN
`bool` : 是否成功关闭
]]
function process.destory(pid)
return process.module.destory(pid)
end
--[[
FUNCTION 获取进程列表
RETURN
`table` : 进程列表
]]
function process.list()
return process.module.list()
end
--[[
FUNCTION 检查文件路径是否存在
PARAM
filepath : 文件路径
RETURN
`table` : 检查结果
]]
function process.exist(filepath)
return process.module.exist(filepath)
end
--[[
FUNCTION 检查PID是否存在
PARAM
pid : 进程ID (PID)
RETURN
`bool` : PID是否存在
]]
function process.exist_pid(pid)
return process.module.exist_pid(pid)
end
--[[
FUNCTION 获取PID路径
PARAM
pid : 进程ID (PID)
RETURN
`string` : PID对应的路径
]]
function process.getpath(pid)
return process.module.getpath(pid)
end
return process