-- 创建(多层)目录, eg:_path = "res/aaa/bbb/ccc"
function file_createDic(_path)
-- 设置SD卡路径
if device.platform == "windows" then
os.execute("mkdir \"" .. _path .. "\"")
else
os.execute("mkdir -p \"" .. _path .. "\"")
end
end
-- 删除目录
function file_delete(_path)
-- 设置SD卡路径
if device.platform == "windows" then
os.execute("rm -rf \"" .. _path .. "\"")
else
os.execute("rm -rf -p \"" .. _path .. "\"")
end
end
--解压到某个目录
function UnzipFile(_path)
if device.platform == "windows" then
print(" UnzipFile ")
-- unzip test.zip -d /root/
os.execute(" unzip \"" .. _path .."\" -d " .." res/test ")
else
os.execute("unzip -p \"" .. _path .. "\"")
end
end
function MainScene:ctor()
-- file_createDic("res/aaa/bbb/ccc")
file_delete("res/aaa")
UnzipFile("res/test/11.zip")
end