lua-users home
lua-l archive

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


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'.

* How to get character code?
 In C language, 'x' means character code of x, but it means
 string "x" in Lua.
   local argc = table.getn(arg)
   local hyphen = string.byte("-", 1)  -- <== how to get character code?
   local i = 1
   while i <= argc and string.byte(arg[i], 1) == hyphen do
     ....
   end

* 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.

--
regards,
kwatch