移動並覆蓋目標 (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