Hacker News new | ask | show | jobs
by Lerc 354 days ago
I'm not a Lua user but is this a falsiness issue?

local function report(result) print(result ?? "The value was nil.") end

report(filesize("/path/to/file/of/length/zero"))

If filesize returns nil for file-not-found and the length otherwise. Wouldn't coalescing work and or would not be able to identify existing but empty files.