lua-users home
lua-l archive

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



---- Original message ----
>Date: Fri, 27 Jun 2008 11:37:41 +0100
>From: David Given <dg@cowlark.com>  
>Subject: Re: io.read() returns immediately under VxWorks  
>To: Lua list <lua@bazar2.conectiva.com.br>
>
>rogerz wrote:
>[...]
>> It runs well under cygwin. But when I run the lua script under VxWorks by
>> vxLuaGlue. System DOES NOT wait for my input ever. It just print menu
>> repeatly. It seems io.read() always returns immediately. Can anyone give me
>> some advice on it?
>
>That sounds as if io.read() is returning EOF --- check it for a nil 
>return value. IIRC, VxWorks doesn't really have stdio, but does have 
>some functions that will allow you to access the console; does vxLuaGlue 
>use these or does it just disallow stdin/stdout?
>
>-- 
>David Given
>dg@cowlark.com
>
>

On this note, VxWorks (at least the version I work with) still has the standard functions gets(), scanf(), etc. so if you need to, you can always write a wrapper for them in C fairly easily. These functions do block by default. However, it does seem odd to me that their file-based counterparts wouldn't work.

-- Matthew P. Del Buono