lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


The following program generates this error message:

lua: bug.lua:19: attempt to close non-closable variable 'database'
stack traceback:
        bug.lua:19: in main chunk
        [C]: in ?

The only variable that gets closed is a FILE* object, so that should be OK.

I've cut everything out of the program that I could.

The code (also attached to the email):

#!/usr/bin/env lua

local fn <const> = "test"


local MAJOR <const> = 1
local MINOR <const> = 1


local init = false
do
    --  determine file size
    local file <close> = assert(io.open(fn, "a+"))
    local size = assert(file:seek("end", 0))
    init = (size == 0)
end


local database = { MAJOR = MAJOR, MINOR = MINOR }


--  vim:ts=4 sts=4 sw=4 et:



--

Attachment: bug.lua
Description: Binary data