[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: [Q] newbie questions about timestamp, character code, ..
- From: "Makoto Kuwata" <kwa@...>
- Date: Fri, 9 Feb 2007 06:04:53 +0900
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