Blog64.6K views1,096 votes0 replies625 following
Lua 5.4 To-Be-Closed Variables: Automatic Cleanup When Scope Ends
Use Lua 5.4's <close> attribute and __close metamethod to close files and other resources automatically when they leave scope, even after errors.