lua-users home
lua-l archive

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


On Fri, 9 Feb 2007 06:04:53 +0900
"Makoto Kuwata" <kwa@kuwata-lab.com> wrote:

> Hi,
> 
> I have just start learning Lua and I have some questions.
> 
> * Is there any way to get timestamp of file?
>   I want to get mtime of file to create software build tool
>   like 'make' or 'ant'.

You can try luafilesystem.

> 
> * How to get character code?
>   In C language, 'x' means character code of x, but it means
>   string "x" in Lua.

string.byte("x") or ("x"):byte()

> 
> * How to check whether table has key or not?
>   'table[key]' cannot check if value of table[key] is nil.
>   I can't find 'table.has_key(aTable, key)' in standard library.
> 

if table[key] then ... end

means that if the given key in the table is non-nil, then...


-- 
Gergo Szakal <bastyaelvtars@gmail.com>