os
clock
function os.clock()
-> number
Returns an approximation of the amount in seconds of CPU time used by the program.
date
function os.date(format?: string, time?: integer)
-> string|osdate
Returns a string or a table containing date and time, formatted according to the given string format.
difftime
function os.difftime(t2: integer, t1: integer)
-> integer
Returns the difference, in seconds, from time t1 to time t2.
execute
function os.execute(command?: string)
-> suc: boolean?
2. exitcode: ("exit"|"signal")?
3. code: integer?
Passes command to be executed by an operating system shell.
exitcode:
| "exit"
| "signal"exit
function os.exit(code?: boolean|integer, close?: boolean)
Calls the ISO C function exit to terminate the host program.
getenv
function os.getenv(varname: string)
-> string?
Returns the value of the process environment variable varname.
remove
function os.remove(filename: string)
-> suc: boolean
2. errmsg: string?
Deletes the file with the given name.
rename
function os.rename(oldname: string, newname: string)
-> suc: boolean
2. errmsg: string?
Renames the file or directory named oldname to newname.
setlocale
function os.setlocale(locale: string|nil, category?: "all"|"collate"|"ctype"|"monetary"|"numeric"...(+1))
-> localecategory: string
Sets the current locale of the program.
category:
-> "all"
| "collate"
| "ctype"
| "monetary"
| "numeric"
| "time"time
function os.time(date?: osdateparam)
-> integer
Returns the current time when called without arguments, or a time representing the local date and time specified by the given table.
tmpname
function os.tmpname()
-> string
Returns a string with a file name that can be used for a temporary file.