Remove A Single Line (LCC.web_file.remove_line)
Signature
line, err = LCC.web_file.remove_line(path, line_number, timeout?)
Parameters
- path
String. File path. - line_number
Number. Line index to delete; positive numbers start at1, negative values count from the end (-1is the last line), and0means after the last line. - timeout
Number, optional. Request timeout in seconds, default60.
Returns
- line
String. Content that was removed;nilon failure. - err
String ornil. Error description when the call fails.
Notes
Convenience wrapper around
remove_linesreturning the deleted text.
See the parameter description above for line-number rules.
Returnsnilwhen nothing is removed.
Example
local line, err = LCC.web_file.remove_line("/config/list.txt", 1)
if line then
print("Removed:", line)
end