Move Files Or Directories (LCC.web_file.move)
Signature
ok, err = LCC.web_file.move(src, target, mode?, timeout?)
Parameters
- src
String. Source path. - target
String. Destination path. - mode
String, optional. Move mode, default"normal"; supports"overwrite","merge","overwrite-merge". - timeout
Number, optional. Request timeout in seconds, default60.
Returns
- ok
Boolean.trueon success,nilon failure. - err
String ornil. Error description when the move fails.
Notes
Moves files or directories; also useful for renaming.
Whensrcis a symlink, the move operates on the link itself and does not rewrite or remove the target content.
Innormalmode the operation fails if the target already exists; other modes behave like their shorthand helpers.
Example
local ok, err = LCC.web_file.move("/scripts/temp.lua", "/scripts/main.lua", "overwrite")
if not ok then
error(err)
end