Append To Controller File (LCC.web_file.appends)
Signature
ok, err = LCC.web_file.appends(path, data, timeout?)
Parameters
- path
String. File path to append. - data
String. Content to append. - timeout
Number, optional. Request timeout in seconds, default60.
Returns
- ok
Boolean.trueon success,falseon failure. - err
String ornil. Error description when the operation fails.
Notes
Appends data to the end of the file.
Missing parent directories and the target file are created automatically.
Useful for continuously extending logs or export records.
Example
local ok, err = LCC.web_file.appends("/logs/task.log", "Finished at 2024-01-01\n")
if not ok then
LCC.log(3, "Append failed", err)
end