移动并覆盖目标 (LCC.web_file.move_overwrite)
声明
ok, err = LCC.web_file.move_overwrite(src, target, timeout?)
参数
- src
字符串型,源路径 - target
字符串型,目标路径 - timeout
数值型,可选;请求超时时间(秒),默认60
返回值
- ok
布尔型,成功返回true,失败返回nil - err
字符串型或nil,失败时的错误描述
说明
web_file.move的便捷封装,等效于mode = "overwrite"。
目标存在时会先删除再移动。
示例
local ok, err = LCC.web_file.move_overwrite("/日志/current.log", "/日志/history.log")
if not ok then
error(err)
end