我需要LUA中的目录列表
假设我有一个目录路径为"C:\ Program Files"
我需要该特定路径中所有文件夹的列表以及如何搜索该列表中的任何特定文件夹.
例
需要路径"C:\ Program Files"中所有文件夹的列表
以下是上述路径中的文件夹名称
文件夹456 789
需要在列表中获得上述内容,然后必须仅搜索文件夹456 789中的文件夹456等特定字符串.
试过下面的代码.我在下面遗漏的东西: -
local function Loc_Lines( str )
--
local ret= {} -- 0 lines
while str do
local _,_,line,tail= string.find( str, "(.-)\n(.+)" )
table.insert( ret, line or str )
str= tail
Print (str)
end
return ret
end
local function Loc_ShellCommand( cmd )
--
local str= nil
--
local f= io.popen( cmd ) -- no command still returns a handle :(
if f …Run Code Online (Sandbox Code Playgroud) 如何在给定字符串中添加双引号字符?
local str = "foo"
Run Code Online (Sandbox Code Playgroud)
如何获取"foo"字符串包含前导和尾随引号的字符串"?
我需要通过Lua脚本重启系统.我需要在Reboot发生之前编写一些字符串,并且需要在Reboot完成后在Lua脚本中编写一个字符串.
示例:
print("Before Reboot System")
Reboot the System through Lua script
print("After Reboot System")
Run Code Online (Sandbox Code Playgroud)
我怎么做到这一点?