Get Path Size (LCC.web_file.size)
Signature
size, err = LCC.web_file.size(path, timeout?)
Parameters
- path
String. File to inspect. - timeout
Number, optional. Request timeout in seconds, default60.
Returns
- size
Number. Size when the path exists;nilotherwise. - err
String ornil. Returns'not found'when the size cannot be determined.
Notes
Retrieves the size by checking whether the path exists.
Regular files return their byte size; directories currently return0.
Returnsnil, 'not found'whenever the size cannot be determined.
Example
local size, err = LCC.web_file.size("/reports/log.txt")
if size then
print("Log size: " .. size .. " bytes")
end