lua-users home
lua-l archive

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


Here's an example of the read() error I've been getting.
After the end of the file, read() return spurious results and
eventually causes a memory access exception.
(On OpenStep 4.2 Mach, at least)

This only happens with the latest version of Lua.
Earlier versions worked ok.

---

-- create a small /tmp/test file before running
function testLuaRead()
    local result = 1
    local count = 0

    readfrom("/tmp/test")

    while ( result ~= nil and count < 100 ) do
       count = count + 1
        result = read("{%s*}%S%S*")
        NSLog("result = "..tostring(result))
    end

end

testLuaRead()