Read File As Lines (LCC.web_file.get_lines)
Signature
lines, err = LCC.web_file.get_lines(path, timeout?)
Parameters
- path
String. File path to read. - timeout
Number, optional. Request timeout in seconds, default60.
Returns
- lines
Table. Array of lines with normalised\nendings;nilon failure. - err
String ornil. Error description when the call fails.
Notes
Reads the entire file and splits it into a line array.
\r\nis normalised to\nbefore splitting.
Example
local lines, err = LCC.web_file.get_lines("/config/list.txt")
if not lines then
error(err)
end
print("Lines:", #lines)