lua-users home
lua-l archive

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


On Fri, Jul 4, 2008 at 5:07 AM, Keith Pimmel <pimmel@ieee.org> wrote:

dummy.lua has the following:
-------------------------------------
print('hello')
io.write('hello')
print('hello')
f=assert(io.open('dummy.out','w'))
f:write('hello')
f:close()

Output from dummy.lua exercised by the lua interpreter:
-----------------------------------
hello
hellohello

and dummy.out contains 'hello' as well

Output from dummy.lua called from my C code:
-----------------------------------
hello
hello
print and io.write has different behaviour in embed environment. I have encounted similar problem under VxWorks too. print works and io.write doesn't. STDIO may be modified by embedded shell. I suggest using different debug msg to locate the statement causing exception?

s.t.

print('hello1')
io.write('hello2')
print('hello3')
f=assert(io.open('dummy.out','w'))
print('hello4')
f:write('hello5')
print('hello6')
f:close()



...and then the dialog comes up: dummy.exe has encountered a problem
and needs to close. Blah blah blah. Please tell Microsoft about this
problem.

dummy.out does not exist, as the execution never made it to that part
of my code.

Further information: I linked against the MinGW-created liblua.a to
get my function exports.

My apologies for the somewhat-long post, but I'm more than a little perplexed.
--
Keith Pimmel
Best Regards!

--
rogerz zhang