Overwrite With Multiple Lines (LCC.web_file.set_lines)
Signature
ok, err = LCC.web_file.set_lines(path, lines, timeout?)
Parameters
- path
String. File to write. - lines
Table. Ordered array of strings. - timeout
Number, optional. Request timeout in seconds, default60.
Returns
- ok
Boolean.trueon success,falseon failure. - err
String ornil. Error description when the write fails.
Notes
Joins the lines and replaces the entire file.
Missing parent directories and the file itself are created automatically.
Ideal for rebuilding configuration or template files.
Example
local ok, err = LCC.web_file.set_lines("/config/list.txt", {"A", "B", "C"})
if not ok then
error(err)
end